repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens listlengths 20 707 | docstring stringlengths 3 17.3k | docstring_tokens listlengths 3 222 | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value | idx int64 0 252k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
dslackw/slpkg | slpkg/grep_md5.py | pkg_checksum | def pkg_checksum(binary, repo):
"""Return checksum from CHECKSUMS.md5 file by repository
"""
md5 = "None"
if repo == "slack_patches" and _meta_.slack_rel == "stable":
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "patches/")).reading()
elif repo == "slack_patches" and _meta_.slack_rel == "cur... | python | def pkg_checksum(binary, repo):
"""Return checksum from CHECKSUMS.md5 file by repository
"""
md5 = "None"
if repo == "slack_patches" and _meta_.slack_rel == "stable":
CHECKSUMS_md5 = URL(mirrors("CHECKSUMS.md5", "patches/")).reading()
elif repo == "slack_patches" and _meta_.slack_rel == "cur... | [
"def",
"pkg_checksum",
"(",
"binary",
",",
"repo",
")",
":",
"md5",
"=",
"\"None\"",
"if",
"repo",
"==",
"\"slack_patches\"",
"and",
"_meta_",
".",
"slack_rel",
"==",
"\"stable\"",
":",
"CHECKSUMS_md5",
"=",
"URL",
"(",
"mirrors",
"(",
"\"CHECKSUMS.md5\"",
"... | Return checksum from CHECKSUMS.md5 file by repository | [
"Return",
"checksum",
"from",
"CHECKSUMS",
".",
"md5",
"file",
"by",
"repository"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/grep_md5.py#L31-L49 | train | 60,300 |
dslackw/slpkg | slpkg/load.py | library | def library(repo):
"""Load packages from slpkg library and from local
"""
pkg_list, packages = [], ""
if repo == "sbo":
if (os.path.isfile(
_meta_.lib_path + "{0}_repo/SLACKBUILDS.TXT".format(repo))):
packages = Utils().read_file(_meta_.lib_path + "{0}_repo/"
... | python | def library(repo):
"""Load packages from slpkg library and from local
"""
pkg_list, packages = [], ""
if repo == "sbo":
if (os.path.isfile(
_meta_.lib_path + "{0}_repo/SLACKBUILDS.TXT".format(repo))):
packages = Utils().read_file(_meta_.lib_path + "{0}_repo/"
... | [
"def",
"library",
"(",
"repo",
")",
":",
"pkg_list",
",",
"packages",
"=",
"[",
"]",
",",
"\"\"",
"if",
"repo",
"==",
"\"sbo\"",
":",
"if",
"(",
"os",
".",
"path",
".",
"isfile",
"(",
"_meta_",
".",
"lib_path",
"+",
"\"{0}_repo/SLACKBUILDS.TXT\"",
".",... | Load packages from slpkg library and from local | [
"Load",
"packages",
"from",
"slpkg",
"library",
"and",
"from",
"local"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/load.py#L34-L57 | train | 60,301 |
dslackw/slpkg | slpkg/sbo/read.py | ReadSBo.info | def info(self, name, sbo_file):
"""Read info file
"""
return URL(self.sbo_url + name + sbo_file).reading() | python | def info(self, name, sbo_file):
"""Read info file
"""
return URL(self.sbo_url + name + sbo_file).reading() | [
"def",
"info",
"(",
"self",
",",
"name",
",",
"sbo_file",
")",
":",
"return",
"URL",
"(",
"self",
".",
"sbo_url",
"+",
"name",
"+",
"sbo_file",
")",
".",
"reading",
"(",
")"
] | Read info file | [
"Read",
"info",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/read.py#L39-L42 | train | 60,302 |
dslackw/slpkg | slpkg/sbo/read.py | ReadSBo.slackbuild | def slackbuild(self, name, sbo_file):
"""Read SlackBuild file
"""
return URL(self.sbo_url + name + sbo_file).reading() | python | def slackbuild(self, name, sbo_file):
"""Read SlackBuild file
"""
return URL(self.sbo_url + name + sbo_file).reading() | [
"def",
"slackbuild",
"(",
"self",
",",
"name",
",",
"sbo_file",
")",
":",
"return",
"URL",
"(",
"self",
".",
"sbo_url",
"+",
"name",
"+",
"sbo_file",
")",
".",
"reading",
"(",
")"
] | Read SlackBuild file | [
"Read",
"SlackBuild",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/read.py#L44-L47 | train | 60,303 |
dslackw/slpkg | slpkg/sbo/autobuild.py | AutoBuild.run | def run(self):
"""Build package and fix ordelist per checksum
"""
self.files_exist()
self.info_file()
sources = self.sources
if len(sources) > 1 and self.sbo_sources != sources:
sources = self.sbo_sources
# If the list does not have the same order use ... | python | def run(self):
"""Build package and fix ordelist per checksum
"""
self.files_exist()
self.info_file()
sources = self.sources
if len(sources) > 1 and self.sbo_sources != sources:
sources = self.sbo_sources
# If the list does not have the same order use ... | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"files_exist",
"(",
")",
"self",
".",
"info_file",
"(",
")",
"sources",
"=",
"self",
".",
"sources",
"if",
"len",
"(",
"sources",
")",
">",
"1",
"and",
"self",
".",
"sbo_sources",
"!=",
"sources",
"... | Build package and fix ordelist per checksum | [
"Build",
"package",
"and",
"fix",
"ordelist",
"per",
"checksum"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/autobuild.py#L43-L54 | train | 60,304 |
dslackw/slpkg | slpkg/sbo/autobuild.py | AutoBuild.info_file | def info_file(self):
"""Grab sources from .info file and store filename
"""
sources = SBoGrep(self.prgnam).source().split()
for source in sources:
self.sbo_sources.append(source.split("/")[-1]) | python | def info_file(self):
"""Grab sources from .info file and store filename
"""
sources = SBoGrep(self.prgnam).source().split()
for source in sources:
self.sbo_sources.append(source.split("/")[-1]) | [
"def",
"info_file",
"(",
"self",
")",
":",
"sources",
"=",
"SBoGrep",
"(",
"self",
".",
"prgnam",
")",
".",
"source",
"(",
")",
".",
"split",
"(",
")",
"for",
"source",
"in",
"sources",
":",
"self",
".",
"sbo_sources",
".",
"append",
"(",
"source",
... | Grab sources from .info file and store filename | [
"Grab",
"sources",
"from",
".",
"info",
"file",
"and",
"store",
"filename"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/autobuild.py#L56-L61 | train | 60,305 |
dslackw/slpkg | slpkg/sbo/autobuild.py | AutoBuild.files_exist | def files_exist(self):
"""Check if SlackBuild archive.tar.gz and sources exist
"""
if not os.path.isfile(self.path + self.script):
print("\nslpkg: Error: SlackBuild archive.tar.gz not found\n")
raise SystemExit()
for src in self.sources:
if not os.path... | python | def files_exist(self):
"""Check if SlackBuild archive.tar.gz and sources exist
"""
if not os.path.isfile(self.path + self.script):
print("\nslpkg: Error: SlackBuild archive.tar.gz not found\n")
raise SystemExit()
for src in self.sources:
if not os.path... | [
"def",
"files_exist",
"(",
"self",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"self",
".",
"path",
"+",
"self",
".",
"script",
")",
":",
"print",
"(",
"\"\\nslpkg: Error: SlackBuild archive.tar.gz not found\\n\"",
")",
"raise",
"SystemExit",... | Check if SlackBuild archive.tar.gz and sources exist | [
"Check",
"if",
"SlackBuild",
"archive",
".",
"tar",
".",
"gz",
"and",
"sources",
"exist"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/autobuild.py#L63-L73 | train | 60,306 |
dslackw/slpkg | slpkg/main.py | ArgParse.help_version | def help_version(self):
"""Help and version info
"""
if (len(self.args) == 1 and self.args[0] in ["-h", "--help"] and
self.args[1:] == []):
options()
elif (len(self.args) == 1 and self.args[0] in ["-v", "--version"] and
self.args[1:] == []):
... | python | def help_version(self):
"""Help and version info
"""
if (len(self.args) == 1 and self.args[0] in ["-h", "--help"] and
self.args[1:] == []):
options()
elif (len(self.args) == 1 and self.args[0] in ["-v", "--version"] and
self.args[1:] == []):
... | [
"def",
"help_version",
"(",
"self",
")",
":",
"if",
"(",
"len",
"(",
"self",
".",
"args",
")",
"==",
"1",
"and",
"self",
".",
"args",
"[",
"0",
"]",
"in",
"[",
"\"-h\"",
",",
"\"--help\"",
"]",
"and",
"self",
".",
"args",
"[",
"1",
":",
"]",
... | Help and version info | [
"Help",
"and",
"version",
"info"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L107-L117 | train | 60,307 |
dslackw/slpkg | slpkg/main.py | ArgParse.command_update | def command_update(self):
"""Update package lists repositories
"""
if len(self.args) == 1 and self.args[0] == "update":
Update().repository(only="")
elif (len(self.args) == 2 and self.args[0] == "update" and
self.args[1].startswith("--only=")):
rep... | python | def command_update(self):
"""Update package lists repositories
"""
if len(self.args) == 1 and self.args[0] == "update":
Update().repository(only="")
elif (len(self.args) == 2 and self.args[0] == "update" and
self.args[1].startswith("--only=")):
rep... | [
"def",
"command_update",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"args",
")",
"==",
"1",
"and",
"self",
".",
"args",
"[",
"0",
"]",
"==",
"\"update\"",
":",
"Update",
"(",
")",
".",
"repository",
"(",
"only",
"=",
"\"\"",
")",
"elif... | Update package lists repositories | [
"Update",
"package",
"lists",
"repositories"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L119-L132 | train | 60,308 |
dslackw/slpkg | slpkg/main.py | ArgParse.command_repo_add | def command_repo_add(self):
"""Add custom repositories
"""
if len(self.args) == 3 and self.args[0] == "repo-add":
Repo().add(self.args[1], self.args[2])
else:
usage("") | python | def command_repo_add(self):
"""Add custom repositories
"""
if len(self.args) == 3 and self.args[0] == "repo-add":
Repo().add(self.args[1], self.args[2])
else:
usage("") | [
"def",
"command_repo_add",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"args",
")",
"==",
"3",
"and",
"self",
".",
"args",
"[",
"0",
"]",
"==",
"\"repo-add\"",
":",
"Repo",
"(",
")",
".",
"add",
"(",
"self",
".",
"args",
"[",
"1",
"]"... | Add custom repositories | [
"Add",
"custom",
"repositories"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L158-L164 | train | 60,309 |
dslackw/slpkg | slpkg/main.py | ArgParse.command_repo_remove | def command_repo_remove(self):
"""Remove custom repositories
"""
if len(self.args) == 2 and self.args[0] == "repo-remove":
Repo().remove(self.args[1])
else:
usage("") | python | def command_repo_remove(self):
"""Remove custom repositories
"""
if len(self.args) == 2 and self.args[0] == "repo-remove":
Repo().remove(self.args[1])
else:
usage("") | [
"def",
"command_repo_remove",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"args",
")",
"==",
"2",
"and",
"self",
".",
"args",
"[",
"0",
"]",
"==",
"\"repo-remove\"",
":",
"Repo",
"(",
")",
".",
"remove",
"(",
"self",
".",
"args",
"[",
"... | Remove custom repositories | [
"Remove",
"custom",
"repositories"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L166-L172 | train | 60,310 |
dslackw/slpkg | slpkg/main.py | ArgParse.command_upgrade | def command_upgrade(self):
"""Recreate repositories package lists
"""
if len(self.args) == 1 and self.args[0] == "upgrade":
Initialization(False).upgrade(only="")
elif (len(self.args) == 2 and self.args[0] == "upgrade" and
self.args[1].startswith("--only=")):
... | python | def command_upgrade(self):
"""Recreate repositories package lists
"""
if len(self.args) == 1 and self.args[0] == "upgrade":
Initialization(False).upgrade(only="")
elif (len(self.args) == 2 and self.args[0] == "upgrade" and
self.args[1].startswith("--only=")):
... | [
"def",
"command_upgrade",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"args",
")",
"==",
"1",
"and",
"self",
".",
"args",
"[",
"0",
"]",
"==",
"\"upgrade\"",
":",
"Initialization",
"(",
"False",
")",
".",
"upgrade",
"(",
"only",
"=",
"\"\... | Recreate repositories package lists | [
"Recreate",
"repositories",
"package",
"lists"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L174-L187 | train | 60,311 |
dslackw/slpkg | slpkg/main.py | ArgParse.command_health | def command_health(self):
"""Check package health
"""
if len(self.args) == 1 and self.args[0] == "health":
PackageHealth(mode="").test()
elif (len(self.args) == 2 and self.args[0] == "health" and
self.args[1] == "--silent"):
PackageHealth(mode=self... | python | def command_health(self):
"""Check package health
"""
if len(self.args) == 1 and self.args[0] == "health":
PackageHealth(mode="").test()
elif (len(self.args) == 2 and self.args[0] == "health" and
self.args[1] == "--silent"):
PackageHealth(mode=self... | [
"def",
"command_health",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"args",
")",
"==",
"1",
"and",
"self",
".",
"args",
"[",
"0",
"]",
"==",
"\"health\"",
":",
"PackageHealth",
"(",
"mode",
"=",
"\"\"",
")",
".",
"test",
"(",
")",
"eli... | Check package health | [
"Check",
"package",
"health"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L202-L211 | train | 60,312 |
dslackw/slpkg | slpkg/main.py | ArgParse.command_deps_status | def command_deps_status(self):
"""Print dependencies status
"""
image = ""
for arg in self.args:
if arg.startswith("--graph="):
image = arg.split("=")[1]
if len(self.args) == 1 and self.args[0] == "deps-status":
DependenciesStatus(image).sh... | python | def command_deps_status(self):
"""Print dependencies status
"""
image = ""
for arg in self.args:
if arg.startswith("--graph="):
image = arg.split("=")[1]
if len(self.args) == 1 and self.args[0] == "deps-status":
DependenciesStatus(image).sh... | [
"def",
"command_deps_status",
"(",
"self",
")",
":",
"image",
"=",
"\"\"",
"for",
"arg",
"in",
"self",
".",
"args",
":",
"if",
"arg",
".",
"startswith",
"(",
"\"--graph=\"",
")",
":",
"image",
"=",
"arg",
".",
"split",
"(",
"\"=\"",
")",
"[",
"1",
... | Print dependencies status | [
"Print",
"dependencies",
"status"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L213-L231 | train | 60,313 |
dslackw/slpkg | slpkg/main.py | ArgParse.command_new_config | def command_new_config(self):
"""Manage .new configuration files
"""
if len(self.args) == 1 and self.args[0] == "new-config":
NewConfig().run()
else:
usage("") | python | def command_new_config(self):
"""Manage .new configuration files
"""
if len(self.args) == 1 and self.args[0] == "new-config":
NewConfig().run()
else:
usage("") | [
"def",
"command_new_config",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"args",
")",
"==",
"1",
"and",
"self",
".",
"args",
"[",
"0",
"]",
"==",
"\"new-config\"",
":",
"NewConfig",
"(",
")",
".",
"run",
"(",
")",
"else",
":",
"usage",
... | Manage .new configuration files | [
"Manage",
".",
"new",
"configuration",
"files"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L233-L239 | train | 60,314 |
dslackw/slpkg | slpkg/main.py | ArgParse.auto_build | def auto_build(self):
"""Auto built tool
"""
options = [
"-a",
"--autobuild"
]
if len(self.args) >= 3 and self.args[0] in options:
AutoBuild(self.args[1], self.args[2:], self.meta.path).run()
else:
usage("") | python | def auto_build(self):
"""Auto built tool
"""
options = [
"-a",
"--autobuild"
]
if len(self.args) >= 3 and self.args[0] in options:
AutoBuild(self.args[1], self.args[2:], self.meta.path).run()
else:
usage("") | [
"def",
"auto_build",
"(",
"self",
")",
":",
"options",
"=",
"[",
"\"-a\"",
",",
"\"--autobuild\"",
"]",
"if",
"len",
"(",
"self",
".",
"args",
")",
">=",
"3",
"and",
"self",
".",
"args",
"[",
"0",
"]",
"in",
"options",
":",
"AutoBuild",
"(",
"self"... | Auto built tool | [
"Auto",
"built",
"tool"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L241-L251 | train | 60,315 |
dslackw/slpkg | slpkg/main.py | ArgParse.pkg_list | def pkg_list(self):
"""List of packages by repository
"""
options = [
"-l",
"--list"
]
flag = ["--index", "--installed", "--name"]
name = INDEX = installed = False
for arg in self.args[2:]:
if flag[0] == arg:
IND... | python | def pkg_list(self):
"""List of packages by repository
"""
options = [
"-l",
"--list"
]
flag = ["--index", "--installed", "--name"]
name = INDEX = installed = False
for arg in self.args[2:]:
if flag[0] == arg:
IND... | [
"def",
"pkg_list",
"(",
"self",
")",
":",
"options",
"=",
"[",
"\"-l\"",
",",
"\"--list\"",
"]",
"flag",
"=",
"[",
"\"--index\"",
",",
"\"--installed\"",
",",
"\"--name\"",
"]",
"name",
"=",
"INDEX",
"=",
"installed",
"=",
"False",
"for",
"arg",
"in",
... | List of packages by repository | [
"List",
"of",
"packages",
"by",
"repository"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L253-L282 | train | 60,316 |
dslackw/slpkg | slpkg/main.py | ArgParse.pkg_upgrade | def pkg_upgrade(self):
"""Check and upgrade packages by repository
"""
options = [
"-c",
"--check"
]
flags = [
"--upgrade",
"--skip=",
"--resolve-off",
"--checklist",
"--rebuild"
]
... | python | def pkg_upgrade(self):
"""Check and upgrade packages by repository
"""
options = [
"-c",
"--check"
]
flags = [
"--upgrade",
"--skip=",
"--resolve-off",
"--checklist",
"--rebuild"
]
... | [
"def",
"pkg_upgrade",
"(",
"self",
")",
":",
"options",
"=",
"[",
"\"-c\"",
",",
"\"--check\"",
"]",
"flags",
"=",
"[",
"\"--upgrade\"",
",",
"\"--skip=\"",
",",
"\"--resolve-off\"",
",",
"\"--checklist\"",
",",
"\"--rebuild\"",
"]",
"flag",
",",
"skip",
"="... | Check and upgrade packages by repository | [
"Check",
"and",
"upgrade",
"packages",
"by",
"repository"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L284-L324 | train | 60,317 |
dslackw/slpkg | slpkg/main.py | ArgParse.__pkg_upgrade_flags | def __pkg_upgrade_flags(self, flags):
"""Manage flags for package upgrade option
"""
flag, skip = [], ""
if flags[0] in self.args:
for arg in self.args[3:]:
if arg.startswith(flags[1]):
skip = Regex(arg.split("=")[1]).get()
... | python | def __pkg_upgrade_flags(self, flags):
"""Manage flags for package upgrade option
"""
flag, skip = [], ""
if flags[0] in self.args:
for arg in self.args[3:]:
if arg.startswith(flags[1]):
skip = Regex(arg.split("=")[1]).get()
... | [
"def",
"__pkg_upgrade_flags",
"(",
"self",
",",
"flags",
")",
":",
"flag",
",",
"skip",
"=",
"[",
"]",
",",
"\"\"",
"if",
"flags",
"[",
"0",
"]",
"in",
"self",
".",
"args",
":",
"for",
"arg",
"in",
"self",
".",
"args",
"[",
"3",
":",
"]",
":",
... | Manage flags for package upgrade option | [
"Manage",
"flags",
"for",
"package",
"upgrade",
"option"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L326-L339 | train | 60,318 |
dslackw/slpkg | slpkg/main.py | ArgParse.pkg_install | def pkg_install(self):
"""Install packages by repository
"""
flag = []
options = [
"-s",
"--sync"
]
additional_options = [
"--resolve-off",
"--download-only",
"--directory-prefix=",
"--case-ins",
... | python | def pkg_install(self):
"""Install packages by repository
"""
flag = []
options = [
"-s",
"--sync"
]
additional_options = [
"--resolve-off",
"--download-only",
"--directory-prefix=",
"--case-ins",
... | [
"def",
"pkg_install",
"(",
"self",
")",
":",
"flag",
"=",
"[",
"]",
"options",
"=",
"[",
"\"-s\"",
",",
"\"--sync\"",
"]",
"additional_options",
"=",
"[",
"\"--resolve-off\"",
",",
"\"--download-only\"",
",",
"\"--directory-prefix=\"",
",",
"\"--case-ins\"",
","... | Install packages by repository | [
"Install",
"packages",
"by",
"repository"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L341-L379 | train | 60,319 |
dslackw/slpkg | slpkg/main.py | ArgParse.pkg_tracking | def pkg_tracking(self):
"""Tracking package dependencies
"""
flag = []
options = [
"-t",
"--tracking"
]
additional_options = [
"--check-deps",
"--graph=",
"--case-ins"
]
for arg in self.args[2:]:
... | python | def pkg_tracking(self):
"""Tracking package dependencies
"""
flag = []
options = [
"-t",
"--tracking"
]
additional_options = [
"--check-deps",
"--graph=",
"--case-ins"
]
for arg in self.args[2:]:
... | [
"def",
"pkg_tracking",
"(",
"self",
")",
":",
"flag",
"=",
"[",
"]",
"options",
"=",
"[",
"\"-t\"",
",",
"\"--tracking\"",
"]",
"additional_options",
"=",
"[",
"\"--check-deps\"",
",",
"\"--graph=\"",
",",
"\"--case-ins\"",
"]",
"for",
"arg",
"in",
"self",
... | Tracking package dependencies | [
"Tracking",
"package",
"dependencies"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L381-L418 | train | 60,320 |
dslackw/slpkg | slpkg/main.py | ArgParse.sbo_network | def sbo_network(self):
"""View slackbuilds packages
"""
flag = []
options = [
"-n",
"--network"
]
additional_options = [
"--checklist",
"--case-ins"
]
for add in additional_options:
if add in self... | python | def sbo_network(self):
"""View slackbuilds packages
"""
flag = []
options = [
"-n",
"--network"
]
additional_options = [
"--checklist",
"--case-ins"
]
for add in additional_options:
if add in self... | [
"def",
"sbo_network",
"(",
"self",
")",
":",
"flag",
"=",
"[",
"]",
"options",
"=",
"[",
"\"-n\"",
",",
"\"--network\"",
"]",
"additional_options",
"=",
"[",
"\"--checklist\"",
",",
"\"--case-ins\"",
"]",
"for",
"add",
"in",
"additional_options",
":",
"if",
... | View slackbuilds packages | [
"View",
"slackbuilds",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L420-L440 | train | 60,321 |
dslackw/slpkg | slpkg/main.py | ArgParse.pkg_blacklist | def pkg_blacklist(self):
"""Manage blacklist packages
"""
blacklist = BlackList()
options = [
"-b",
"--blacklist"
]
flag = [
"--add",
"--remove"
]
command = ["list"]
if (len(self.args) == 2 and self.a... | python | def pkg_blacklist(self):
"""Manage blacklist packages
"""
blacklist = BlackList()
options = [
"-b",
"--blacklist"
]
flag = [
"--add",
"--remove"
]
command = ["list"]
if (len(self.args) == 2 and self.a... | [
"def",
"pkg_blacklist",
"(",
"self",
")",
":",
"blacklist",
"=",
"BlackList",
"(",
")",
"options",
"=",
"[",
"\"-b\"",
",",
"\"--blacklist\"",
"]",
"flag",
"=",
"[",
"\"--add\"",
",",
"\"--remove\"",
"]",
"command",
"=",
"[",
"\"list\"",
"]",
"if",
"(",
... | Manage blacklist packages | [
"Manage",
"blacklist",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L442-L471 | train | 60,322 |
dslackw/slpkg | slpkg/main.py | ArgParse.pkg_queue | def pkg_queue(self):
"""Manage packages in queue
"""
queue = QueuePkgs()
options = [
"-q",
"--queue"
]
flag = [
"--add",
"--remove"
]
command = [
"list",
"build",
"install"... | python | def pkg_queue(self):
"""Manage packages in queue
"""
queue = QueuePkgs()
options = [
"-q",
"--queue"
]
flag = [
"--add",
"--remove"
]
command = [
"list",
"build",
"install"... | [
"def",
"pkg_queue",
"(",
"self",
")",
":",
"queue",
"=",
"QueuePkgs",
"(",
")",
"options",
"=",
"[",
"\"-q\"",
",",
"\"--queue\"",
"]",
"flag",
"=",
"[",
"\"--add\"",
",",
"\"--remove\"",
"]",
"command",
"=",
"[",
"\"list\"",
",",
"\"build\"",
",",
"\"... | Manage packages in queue | [
"Manage",
"packages",
"in",
"queue"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L473-L517 | train | 60,323 |
dslackw/slpkg | slpkg/main.py | ArgParse.bin_install | def bin_install(self):
"""Install Slackware binary packages
"""
packages = self.args[1:]
options = [
"-i",
"--installpkg"
]
flag = ""
flags = [
"--warn",
"--md5sum",
"--root",
"--infobox",
... | python | def bin_install(self):
"""Install Slackware binary packages
"""
packages = self.args[1:]
options = [
"-i",
"--installpkg"
]
flag = ""
flags = [
"--warn",
"--md5sum",
"--root",
"--infobox",
... | [
"def",
"bin_install",
"(",
"self",
")",
":",
"packages",
"=",
"self",
".",
"args",
"[",
"1",
":",
"]",
"options",
"=",
"[",
"\"-i\"",
",",
"\"--installpkg\"",
"]",
"flag",
"=",
"\"\"",
"flags",
"=",
"[",
"\"--warn\"",
",",
"\"--md5sum\"",
",",
"\"--roo... | Install Slackware binary packages | [
"Install",
"Slackware",
"binary",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L519-L545 | train | 60,324 |
dslackw/slpkg | slpkg/main.py | ArgParse.bin_upgrade | def bin_upgrade(self):
"""Install-upgrade Slackware binary packages
"""
packages = self.args[1:]
options = [
"-u",
"--upgradepkg"
]
flag = ""
flags = [
"--dry-run",
"--install-new",
"--reinstall",
... | python | def bin_upgrade(self):
"""Install-upgrade Slackware binary packages
"""
packages = self.args[1:]
options = [
"-u",
"--upgradepkg"
]
flag = ""
flags = [
"--dry-run",
"--install-new",
"--reinstall",
... | [
"def",
"bin_upgrade",
"(",
"self",
")",
":",
"packages",
"=",
"self",
".",
"args",
"[",
"1",
":",
"]",
"options",
"=",
"[",
"\"-u\"",
",",
"\"--upgradepkg\"",
"]",
"flag",
"=",
"\"\"",
"flags",
"=",
"[",
"\"--dry-run\"",
",",
"\"--install-new\"",
",",
... | Install-upgrade Slackware binary packages | [
"Install",
"-",
"upgrade",
"Slackware",
"binary",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L547-L568 | train | 60,325 |
dslackw/slpkg | slpkg/main.py | ArgParse.bin_remove | def bin_remove(self):
"""Remove Slackware packages
"""
packages = self.args[1:]
options = [
"-r",
"--removepkg"
]
additional_options = [
"--deps",
"--check-deps",
"--tag",
"--checklist"
]
... | python | def bin_remove(self):
"""Remove Slackware packages
"""
packages = self.args[1:]
options = [
"-r",
"--removepkg"
]
additional_options = [
"--deps",
"--check-deps",
"--tag",
"--checklist"
]
... | [
"def",
"bin_remove",
"(",
"self",
")",
":",
"packages",
"=",
"self",
".",
"args",
"[",
"1",
":",
"]",
"options",
"=",
"[",
"\"-r\"",
",",
"\"--removepkg\"",
"]",
"additional_options",
"=",
"[",
"\"--deps\"",
",",
"\"--check-deps\"",
",",
"\"--tag\"",
",",
... | Remove Slackware packages | [
"Remove",
"Slackware",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L570-L607 | train | 60,326 |
dslackw/slpkg | slpkg/main.py | ArgParse.bin_find | def bin_find(self):
"""Find installed packages
"""
flag = []
options = [
"-f",
"--find"
]
additional_options = ["--case-ins"]
for arg in self.args:
if arg in additional_options:
flag.append(arg)
s... | python | def bin_find(self):
"""Find installed packages
"""
flag = []
options = [
"-f",
"--find"
]
additional_options = ["--case-ins"]
for arg in self.args:
if arg in additional_options:
flag.append(arg)
s... | [
"def",
"bin_find",
"(",
"self",
")",
":",
"flag",
"=",
"[",
"]",
"options",
"=",
"[",
"\"-f\"",
",",
"\"--find\"",
"]",
"additional_options",
"=",
"[",
"\"--case-ins\"",
"]",
"for",
"arg",
"in",
"self",
".",
"args",
":",
"if",
"arg",
"in",
"additional_... | Find installed packages | [
"Find",
"installed",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L609-L626 | train | 60,327 |
dslackw/slpkg | slpkg/main.py | ArgParse.pkg_desc | def pkg_desc(self):
"""Print slack-desc by repository
"""
options = [
"-p",
"--desc"
]
flag = ["--color="]
colors = [
"red",
"green",
"yellow",
"cyan",
"grey"
]
tag = ""
... | python | def pkg_desc(self):
"""Print slack-desc by repository
"""
options = [
"-p",
"--desc"
]
flag = ["--color="]
colors = [
"red",
"green",
"yellow",
"cyan",
"grey"
]
tag = ""
... | [
"def",
"pkg_desc",
"(",
"self",
")",
":",
"options",
"=",
"[",
"\"-p\"",
",",
"\"--desc\"",
"]",
"flag",
"=",
"[",
"\"--color=\"",
"]",
"colors",
"=",
"[",
"\"red\"",
",",
"\"green\"",
",",
"\"yellow\"",
",",
"\"cyan\"",
",",
"\"grey\"",
"]",
"tag",
"=... | Print slack-desc by repository | [
"Print",
"slack",
"-",
"desc",
"by",
"repository"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L628-L663 | train | 60,328 |
dslackw/slpkg | slpkg/main.py | ArgParse.pkg_find | def pkg_find(self):
"""Find packages from all enabled repositories
"""
flag = []
options = [
"-F",
"--FIND"
]
additional_options = ["--case-ins"]
for arg in self.args:
if arg in additional_options:
flag.append(ar... | python | def pkg_find(self):
"""Find packages from all enabled repositories
"""
flag = []
options = [
"-F",
"--FIND"
]
additional_options = ["--case-ins"]
for arg in self.args:
if arg in additional_options:
flag.append(ar... | [
"def",
"pkg_find",
"(",
"self",
")",
":",
"flag",
"=",
"[",
"]",
"options",
"=",
"[",
"\"-F\"",
",",
"\"--FIND\"",
"]",
"additional_options",
"=",
"[",
"\"--case-ins\"",
"]",
"for",
"arg",
"in",
"self",
".",
"args",
":",
"if",
"arg",
"in",
"additional_... | Find packages from all enabled repositories | [
"Find",
"packages",
"from",
"all",
"enabled",
"repositories"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L665-L682 | train | 60,329 |
dslackw/slpkg | slpkg/main.py | ArgParse.pkg_contents | def pkg_contents(self):
"""Print packages contents
"""
packages = self.args[1:]
options = [
"-d",
"--display"
]
if len(self.args) > 1 and self.args[0] in options:
PackageManager(packages).display()
else:
usage("") | python | def pkg_contents(self):
"""Print packages contents
"""
packages = self.args[1:]
options = [
"-d",
"--display"
]
if len(self.args) > 1 and self.args[0] in options:
PackageManager(packages).display()
else:
usage("") | [
"def",
"pkg_contents",
"(",
"self",
")",
":",
"packages",
"=",
"self",
".",
"args",
"[",
"1",
":",
"]",
"options",
"=",
"[",
"\"-d\"",
",",
"\"--display\"",
"]",
"if",
"len",
"(",
"self",
".",
"args",
")",
">",
"1",
"and",
"self",
".",
"args",
"[... | Print packages contents | [
"Print",
"packages",
"contents"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L684-L695 | train | 60,330 |
dslackw/slpkg | slpkg/main.py | ArgParse.congiguration | def congiguration(self):
"""Manage slpkg configuration file
"""
options = [
"-g",
"--config"
]
command = [
"print",
"edit",
"reset"
]
conf = Config()
if (len(self.args) == 2 and self.args[0] in op... | python | def congiguration(self):
"""Manage slpkg configuration file
"""
options = [
"-g",
"--config"
]
command = [
"print",
"edit",
"reset"
]
conf = Config()
if (len(self.args) == 2 and self.args[0] in op... | [
"def",
"congiguration",
"(",
"self",
")",
":",
"options",
"=",
"[",
"\"-g\"",
",",
"\"--config\"",
"]",
"command",
"=",
"[",
"\"print\"",
",",
"\"edit\"",
",",
"\"reset\"",
"]",
"conf",
"=",
"Config",
"(",
")",
"if",
"(",
"len",
"(",
"self",
".",
"ar... | Manage slpkg configuration file | [
"Manage",
"slpkg",
"configuration",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L697-L720 | train | 60,331 |
dslackw/slpkg | slpkg/main.py | ArgParse.auto_detect | def auto_detect(self, args):
"""Check for already Slackware binary packages exist
"""
suffixes = [
".tgz",
".txz",
".tbz",
".tlz"
]
if (not args[0].startswith("-") and args[0] not in self.commands and
args[0].endswit... | python | def auto_detect(self, args):
"""Check for already Slackware binary packages exist
"""
suffixes = [
".tgz",
".txz",
".tbz",
".tlz"
]
if (not args[0].startswith("-") and args[0] not in self.commands and
args[0].endswit... | [
"def",
"auto_detect",
"(",
"self",
",",
"args",
")",
":",
"suffixes",
"=",
"[",
"\".tgz\"",
",",
"\".txz\"",
",",
"\".tbz\"",
",",
"\".tlz\"",
"]",
"if",
"(",
"not",
"args",
"[",
"0",
"]",
".",
"startswith",
"(",
"\"-\"",
")",
"and",
"args",
"[",
"... | Check for already Slackware binary packages exist | [
"Check",
"for",
"already",
"Slackware",
"binary",
"packages",
"exist"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/main.py#L722-L745 | train | 60,332 |
dslackw/slpkg | slpkg/binary/search.py | search_pkg | def search_pkg(name, repo):
"""Search if package exists in PACKAGES.TXT file
and return the name.
"""
PACKAGES_TXT = Utils().read_file(_meta_.lib_path + "{0}_repo/"
"PACKAGES.TXT".format(repo))
names = Utils().package_name(PACKAGES_TXT)
blacklist = BlackList(... | python | def search_pkg(name, repo):
"""Search if package exists in PACKAGES.TXT file
and return the name.
"""
PACKAGES_TXT = Utils().read_file(_meta_.lib_path + "{0}_repo/"
"PACKAGES.TXT".format(repo))
names = Utils().package_name(PACKAGES_TXT)
blacklist = BlackList(... | [
"def",
"search_pkg",
"(",
"name",
",",
"repo",
")",
":",
"PACKAGES_TXT",
"=",
"Utils",
"(",
")",
".",
"read_file",
"(",
"_meta_",
".",
"lib_path",
"+",
"\"{0}_repo/\"",
"\"PACKAGES.TXT\"",
".",
"format",
"(",
"repo",
")",
")",
"names",
"=",
"Utils",
"(",... | Search if package exists in PACKAGES.TXT file
and return the name. | [
"Search",
"if",
"package",
"exists",
"in",
"PACKAGES",
".",
"TXT",
"file",
"and",
"return",
"the",
"name",
"."
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/binary/search.py#L32-L45 | train | 60,333 |
dslackw/slpkg | slpkg/status_deps.py | DependenciesStatus.data | def data(self):
"""Check all installed packages and create
dictionary database
"""
for pkg in self.installed:
if os.path.isfile(self.meta.pkg_path + pkg):
name = split_package(pkg)[0]
for log in self.logs:
deps = Utils().rea... | python | def data(self):
"""Check all installed packages and create
dictionary database
"""
for pkg in self.installed:
if os.path.isfile(self.meta.pkg_path + pkg):
name = split_package(pkg)[0]
for log in self.logs:
deps = Utils().rea... | [
"def",
"data",
"(",
"self",
")",
":",
"for",
"pkg",
"in",
"self",
".",
"installed",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"self",
".",
"meta",
".",
"pkg_path",
"+",
"pkg",
")",
":",
"name",
"=",
"split_package",
"(",
"pkg",
")",
"[",
... | Check all installed packages and create
dictionary database | [
"Check",
"all",
"installed",
"packages",
"and",
"create",
"dictionary",
"database"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/status_deps.py#L56-L73 | train | 60,334 |
dslackw/slpkg | slpkg/status_deps.py | DependenciesStatus.count_packages | def count_packages(self):
"""Count dependencies and packages
"""
packages = []
for pkg in self.dmap.values():
packages += pkg
self.count_dep += 1
self.count_pkg = len(set(packages)) | python | def count_packages(self):
"""Count dependencies and packages
"""
packages = []
for pkg in self.dmap.values():
packages += pkg
self.count_dep += 1
self.count_pkg = len(set(packages)) | [
"def",
"count_packages",
"(",
"self",
")",
":",
"packages",
"=",
"[",
"]",
"for",
"pkg",
"in",
"self",
".",
"dmap",
".",
"values",
"(",
")",
":",
"packages",
"+=",
"pkg",
"self",
".",
"count_dep",
"+=",
"1",
"self",
".",
"count_pkg",
"=",
"len",
"(... | Count dependencies and packages | [
"Count",
"dependencies",
"and",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/status_deps.py#L75-L82 | train | 60,335 |
dslackw/slpkg | slpkg/status_deps.py | DependenciesStatus.show | def show(self):
"""Show dependencies status
"""
self.data()
print("")
self.msg.template(78)
print("| {0}{1}{2}".format("Dependencies", " " * 20, "Packages"))
self.msg.template(78)
for key, value in self.dmap.iteritems():
print(" {0}{1}{2}{3}{4... | python | def show(self):
"""Show dependencies status
"""
self.data()
print("")
self.msg.template(78)
print("| {0}{1}{2}".format("Dependencies", " " * 20, "Packages"))
self.msg.template(78)
for key, value in self.dmap.iteritems():
print(" {0}{1}{2}{3}{4... | [
"def",
"show",
"(",
"self",
")",
":",
"self",
".",
"data",
"(",
")",
"print",
"(",
"\"\"",
")",
"self",
".",
"msg",
".",
"template",
"(",
"78",
")",
"print",
"(",
"\"| {0}{1}{2}\"",
".",
"format",
"(",
"\"Dependencies\"",
",",
"\" \"",
"*",
"20",
"... | Show dependencies status | [
"Show",
"dependencies",
"status"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/status_deps.py#L84-L98 | train | 60,336 |
dslackw/slpkg | slpkg/status_deps.py | DependenciesStatus.tree | def tree(self):
"""Like tree view mode
"""
self.msg.template(78)
print("| Dependencies\n"
"| -- Packages")
self.msg.template(78)
self.data()
for pkg, dep in self.dmap.iteritems():
print("+ {0}{1}{2}".format(self.green, pkg, self.endc))
... | python | def tree(self):
"""Like tree view mode
"""
self.msg.template(78)
print("| Dependencies\n"
"| -- Packages")
self.msg.template(78)
self.data()
for pkg, dep in self.dmap.iteritems():
print("+ {0}{1}{2}".format(self.green, pkg, self.endc))
... | [
"def",
"tree",
"(",
"self",
")",
":",
"self",
".",
"msg",
".",
"template",
"(",
"78",
")",
"print",
"(",
"\"| Dependencies\\n\"",
"\"| -- Packages\"",
")",
"self",
".",
"msg",
".",
"template",
"(",
"78",
")",
"self",
".",
"data",
"(",
")",
"for",
"pk... | Like tree view mode | [
"Like",
"tree",
"view",
"mode"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/status_deps.py#L100-L118 | train | 60,337 |
dslackw/slpkg | slpkg/status_deps.py | DependenciesStatus.summary | def summary(self):
"""Summary by packages and dependencies
"""
print("\nStatus summary")
print("=" * 79)
print("{0}found {1} dependencies in {2} packages.{3}\n".format(
self.grey, self.count_dep, self.count_pkg, self.endc)) | python | def summary(self):
"""Summary by packages and dependencies
"""
print("\nStatus summary")
print("=" * 79)
print("{0}found {1} dependencies in {2} packages.{3}\n".format(
self.grey, self.count_dep, self.count_pkg, self.endc)) | [
"def",
"summary",
"(",
"self",
")",
":",
"print",
"(",
"\"\\nStatus summary\"",
")",
"print",
"(",
"\"=\"",
"*",
"79",
")",
"print",
"(",
"\"{0}found {1} dependencies in {2} packages.{3}\\n\"",
".",
"format",
"(",
"self",
".",
"grey",
",",
"self",
".",
"count_... | Summary by packages and dependencies | [
"Summary",
"by",
"packages",
"and",
"dependencies"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/status_deps.py#L128-L134 | train | 60,338 |
dslackw/slpkg | slpkg/pkg_find.py | FindFromRepos.find | def find(self, pkg, flag):
"""Start to find packages and print
"""
print("\nPackages with name matching [ {0}{1}{2} ]\n".format(
self.cyan, ", ".join(pkg), self.endc))
Msg().template(78)
print("| {0} {1}{2}{3}".format("Repository", "Package", " " * 54,
... | python | def find(self, pkg, flag):
"""Start to find packages and print
"""
print("\nPackages with name matching [ {0}{1}{2} ]\n".format(
self.cyan, ", ".join(pkg), self.endc))
Msg().template(78)
print("| {0} {1}{2}{3}".format("Repository", "Package", " " * 54,
... | [
"def",
"find",
"(",
"self",
",",
"pkg",
",",
"flag",
")",
":",
"print",
"(",
"\"\\nPackages with name matching [ {0}{1}{2} ]\\n\"",
".",
"format",
"(",
"self",
".",
"cyan",
",",
"\", \"",
".",
"join",
"(",
"pkg",
")",
",",
"self",
".",
"endc",
")",
")",
... | Start to find packages and print | [
"Start",
"to",
"find",
"packages",
"and",
"print"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/pkg_find.py#L45-L80 | train | 60,339 |
dslackw/slpkg | slpkg/pkg_find.py | FindFromRepos.sbo_version | def sbo_version(self, repo, find):
"""
Add version to SBo packages
"""
ver = ""
if repo == "sbo":
ver = "-" + SBoGrep(find).version()
return ver | python | def sbo_version(self, repo, find):
"""
Add version to SBo packages
"""
ver = ""
if repo == "sbo":
ver = "-" + SBoGrep(find).version()
return ver | [
"def",
"sbo_version",
"(",
"self",
",",
"repo",
",",
"find",
")",
":",
"ver",
"=",
"\"\"",
"if",
"repo",
"==",
"\"sbo\"",
":",
"ver",
"=",
"\"-\"",
"+",
"SBoGrep",
"(",
"find",
")",
".",
"version",
"(",
")",
"return",
"ver"
] | Add version to SBo packages | [
"Add",
"version",
"to",
"SBo",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/pkg_find.py#L82-L89 | train | 60,340 |
dslackw/slpkg | slpkg/repositories.py | Repo.add | def add(self, repo, url):
"""Write custom repository name and url in a file
"""
repo_name = []
if not url.endswith("/"):
url = url + "/"
for line in self.custom_repositories_list.splitlines():
line = line.lstrip()
if line and not line.startswit... | python | def add(self, repo, url):
"""Write custom repository name and url in a file
"""
repo_name = []
if not url.endswith("/"):
url = url + "/"
for line in self.custom_repositories_list.splitlines():
line = line.lstrip()
if line and not line.startswit... | [
"def",
"add",
"(",
"self",
",",
"repo",
",",
"url",
")",
":",
"repo_name",
"=",
"[",
"]",
"if",
"not",
"url",
".",
"endswith",
"(",
"\"/\"",
")",
":",
"url",
"=",
"url",
"+",
"\"/\"",
"for",
"line",
"in",
"self",
".",
"custom_repositories_list",
".... | Write custom repository name and url in a file | [
"Write",
"custom",
"repository",
"name",
"and",
"url",
"in",
"a",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/repositories.py#L44-L69 | train | 60,341 |
dslackw/slpkg | slpkg/repositories.py | Repo.remove | def remove(self, repo):
"""Remove custom repository
"""
rem_repo = False
with open(self.custom_repo_file, "w") as repos:
for line in self.custom_repositories_list.splitlines():
repo_name = line.split()[0]
if repo_name != repo:
... | python | def remove(self, repo):
"""Remove custom repository
"""
rem_repo = False
with open(self.custom_repo_file, "w") as repos:
for line in self.custom_repositories_list.splitlines():
repo_name = line.split()[0]
if repo_name != repo:
... | [
"def",
"remove",
"(",
"self",
",",
"repo",
")",
":",
"rem_repo",
"=",
"False",
"with",
"open",
"(",
"self",
".",
"custom_repo_file",
",",
"\"w\"",
")",
"as",
"repos",
":",
"for",
"line",
"in",
"self",
".",
"custom_repositories_list",
".",
"splitlines",
"... | Remove custom repository | [
"Remove",
"custom",
"repository"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/repositories.py#L71-L87 | train | 60,342 |
dslackw/slpkg | slpkg/repositories.py | Repo.default_repository | def default_repository(self):
"""Return dictionary with default repo name and url
"""
default_dict_repo = {}
for line in self.default_repositories_list.splitlines():
line = line.lstrip()
if not line.startswith("#"):
if line.split()[0] in self.DEFAU... | python | def default_repository(self):
"""Return dictionary with default repo name and url
"""
default_dict_repo = {}
for line in self.default_repositories_list.splitlines():
line = line.lstrip()
if not line.startswith("#"):
if line.split()[0] in self.DEFAU... | [
"def",
"default_repository",
"(",
"self",
")",
":",
"default_dict_repo",
"=",
"{",
"}",
"for",
"line",
"in",
"self",
".",
"default_repositories_list",
".",
"splitlines",
"(",
")",
":",
"line",
"=",
"line",
".",
"lstrip",
"(",
")",
"if",
"not",
"line",
".... | Return dictionary with default repo name and url | [
"Return",
"dictionary",
"with",
"default",
"repo",
"name",
"and",
"url"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/repositories.py#L99-L114 | train | 60,343 |
dslackw/slpkg | slpkg/repositories.py | Repo.slack | def slack(self):
"""Official slackware repository
"""
default = "http://mirrors.slackware.com/slackware/"
if self.meta.arch.startswith("arm"):
default = "http://ftp.arm.slackware.com/slackwarearm/"
if os.path.isfile("/etc/slpkg/slackware-mirrors"):
mirrors... | python | def slack(self):
"""Official slackware repository
"""
default = "http://mirrors.slackware.com/slackware/"
if self.meta.arch.startswith("arm"):
default = "http://ftp.arm.slackware.com/slackwarearm/"
if os.path.isfile("/etc/slpkg/slackware-mirrors"):
mirrors... | [
"def",
"slack",
"(",
"self",
")",
":",
"default",
"=",
"\"http://mirrors.slackware.com/slackware/\"",
"if",
"self",
".",
"meta",
".",
"arch",
".",
"startswith",
"(",
"\"arm\"",
")",
":",
"default",
"=",
"\"http://ftp.arm.slackware.com/slackwarearm/\"",
"if",
"os",
... | Official slackware repository | [
"Official",
"slackware",
"repository"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/repositories.py#L116-L131 | train | 60,344 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.view | def view(self):
"""View SlackBuild package, read or install them
from slackbuilds.org
"""
if self.sbo_url and self.name not in self.blacklist:
self.prgnam = ("{0}-{1}".format(self.name, self.sbo_version))
self.view_sbo()
while True:
sel... | python | def view(self):
"""View SlackBuild package, read or install them
from slackbuilds.org
"""
if self.sbo_url and self.name not in self.blacklist:
self.prgnam = ("{0}-{1}".format(self.name, self.sbo_version))
self.view_sbo()
while True:
sel... | [
"def",
"view",
"(",
"self",
")",
":",
"if",
"self",
".",
"sbo_url",
"and",
"self",
".",
"name",
"not",
"in",
"self",
".",
"blacklist",
":",
"self",
".",
"prgnam",
"=",
"(",
"\"{0}-{1}\"",
".",
"format",
"(",
"self",
".",
"name",
",",
"self",
".",
... | View SlackBuild package, read or install them
from slackbuilds.org | [
"View",
"SlackBuild",
"package",
"read",
"or",
"install",
"them",
"from",
"slackbuilds",
".",
"org"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L92-L132 | train | 60,345 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.choice_README | def choice_README(self):
"""View README file
"""
README = ReadSBo(self.sbo_url).readme("README")
fill = self.fill_pager(README)
self.pager(README + fill) | python | def choice_README(self):
"""View README file
"""
README = ReadSBo(self.sbo_url).readme("README")
fill = self.fill_pager(README)
self.pager(README + fill) | [
"def",
"choice_README",
"(",
"self",
")",
":",
"README",
"=",
"ReadSBo",
"(",
"self",
".",
"sbo_url",
")",
".",
"readme",
"(",
"\"README\"",
")",
"fill",
"=",
"self",
".",
"fill_pager",
"(",
"README",
")",
"self",
".",
"pager",
"(",
"README",
"+",
"f... | View README file | [
"View",
"README",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L187-L192 | train | 60,346 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.choice_SlackBuild | def choice_SlackBuild(self):
"""View .SlackBuild file
"""
SlackBuild = ReadSBo(self.sbo_url).slackbuild(self.name, ".SlackBuild")
fill = self.fill_pager(SlackBuild)
self.pager(SlackBuild + fill) | python | def choice_SlackBuild(self):
"""View .SlackBuild file
"""
SlackBuild = ReadSBo(self.sbo_url).slackbuild(self.name, ".SlackBuild")
fill = self.fill_pager(SlackBuild)
self.pager(SlackBuild + fill) | [
"def",
"choice_SlackBuild",
"(",
"self",
")",
":",
"SlackBuild",
"=",
"ReadSBo",
"(",
"self",
".",
"sbo_url",
")",
".",
"slackbuild",
"(",
"self",
".",
"name",
",",
"\".SlackBuild\"",
")",
"fill",
"=",
"self",
".",
"fill_pager",
"(",
"SlackBuild",
")",
"... | View .SlackBuild file | [
"View",
".",
"SlackBuild",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L194-L199 | train | 60,347 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.choice_info | def choice_info(self):
"""View .info file
"""
info = ReadSBo(self.sbo_url).info(self.name, ".info")
fill = self.fill_pager(info)
self.pager(info + fill) | python | def choice_info(self):
"""View .info file
"""
info = ReadSBo(self.sbo_url).info(self.name, ".info")
fill = self.fill_pager(info)
self.pager(info + fill) | [
"def",
"choice_info",
"(",
"self",
")",
":",
"info",
"=",
"ReadSBo",
"(",
"self",
".",
"sbo_url",
")",
".",
"info",
"(",
"self",
".",
"name",
",",
"\".info\"",
")",
"fill",
"=",
"self",
".",
"fill_pager",
"(",
"info",
")",
"self",
".",
"pager",
"("... | View .info file | [
"View",
".",
"info",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L201-L206 | train | 60,348 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.choice_doinst | def choice_doinst(self):
"""View doinst.sh file
"""
if "doinst.sh" in self.sbo_files.split():
doinst_sh = ReadSBo(self.sbo_url).doinst("doinst.sh")
fill = self.fill_pager(doinst_sh)
self.pager(doinst_sh + fill) | python | def choice_doinst(self):
"""View doinst.sh file
"""
if "doinst.sh" in self.sbo_files.split():
doinst_sh = ReadSBo(self.sbo_url).doinst("doinst.sh")
fill = self.fill_pager(doinst_sh)
self.pager(doinst_sh + fill) | [
"def",
"choice_doinst",
"(",
"self",
")",
":",
"if",
"\"doinst.sh\"",
"in",
"self",
".",
"sbo_files",
".",
"split",
"(",
")",
":",
"doinst_sh",
"=",
"ReadSBo",
"(",
"self",
".",
"sbo_url",
")",
".",
"doinst",
"(",
"\"doinst.sh\"",
")",
"fill",
"=",
"se... | View doinst.sh file | [
"View",
"doinst",
".",
"sh",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L208-L214 | train | 60,349 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.choice_download | def choice_download(self):
"""Download script.tar.gz and sources
"""
Download(path="", url=self.dwn_srcs, repo="sbo").start()
raise SystemExit() | python | def choice_download(self):
"""Download script.tar.gz and sources
"""
Download(path="", url=self.dwn_srcs, repo="sbo").start()
raise SystemExit() | [
"def",
"choice_download",
"(",
"self",
")",
":",
"Download",
"(",
"path",
"=",
"\"\"",
",",
"url",
"=",
"self",
".",
"dwn_srcs",
",",
"repo",
"=",
"\"sbo\"",
")",
".",
"start",
"(",
")",
"raise",
"SystemExit",
"(",
")"
] | Download script.tar.gz and sources | [
"Download",
"script",
".",
"tar",
".",
"gz",
"and",
"sources"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L216-L220 | train | 60,350 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.choice_install | def choice_install(self):
"""Download, build and install package
"""
pkg_security([self.name])
if not find_package(self.prgnam, self.meta.pkg_path):
self.build()
self.install()
delete(self.build_folder)
raise SystemExit()
else:
... | python | def choice_install(self):
"""Download, build and install package
"""
pkg_security([self.name])
if not find_package(self.prgnam, self.meta.pkg_path):
self.build()
self.install()
delete(self.build_folder)
raise SystemExit()
else:
... | [
"def",
"choice_install",
"(",
"self",
")",
":",
"pkg_security",
"(",
"[",
"self",
".",
"name",
"]",
")",
"if",
"not",
"find_package",
"(",
"self",
".",
"prgnam",
",",
"self",
".",
"meta",
".",
"pkg_path",
")",
":",
"self",
".",
"build",
"(",
")",
"... | Download, build and install package | [
"Download",
"build",
"and",
"install",
"package"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L229-L242 | train | 60,351 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.with_checklist | def with_checklist(self):
"""Using dialog and checklist option
"""
data = []
if self.name == "ALL":
data = self.data
else:
for name in self.data:
if self.name in name:
data.append(name)
if data:
text ... | python | def with_checklist(self):
"""Using dialog and checklist option
"""
data = []
if self.name == "ALL":
data = self.data
else:
for name in self.data:
if self.name in name:
data.append(name)
if data:
text ... | [
"def",
"with_checklist",
"(",
"self",
")",
":",
"data",
"=",
"[",
"]",
"if",
"self",
".",
"name",
"==",
"\"ALL\"",
":",
"data",
"=",
"self",
".",
"data",
"else",
":",
"for",
"name",
"in",
"self",
".",
"data",
":",
"if",
"self",
".",
"name",
"in",... | Using dialog and checklist option | [
"Using",
"dialog",
"and",
"checklist",
"option"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L309-L331 | train | 60,352 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.fill_pager | def fill_pager(self, page):
"""Fix pager spaces
"""
tty_size = os.popen("stty size", "r").read().split()
rows = int(tty_size[0]) - 1
lines = sum(1 for line in page.splitlines())
diff = rows - lines
fill = "\n" * diff
if diff > 0:
return fill
... | python | def fill_pager(self, page):
"""Fix pager spaces
"""
tty_size = os.popen("stty size", "r").read().split()
rows = int(tty_size[0]) - 1
lines = sum(1 for line in page.splitlines())
diff = rows - lines
fill = "\n" * diff
if diff > 0:
return fill
... | [
"def",
"fill_pager",
"(",
"self",
",",
"page",
")",
":",
"tty_size",
"=",
"os",
".",
"popen",
"(",
"\"stty size\"",
",",
"\"r\"",
")",
".",
"read",
"(",
")",
".",
"split",
"(",
")",
"rows",
"=",
"int",
"(",
"tty_size",
"[",
"0",
"]",
")",
"-",
... | Fix pager spaces | [
"Fix",
"pager",
"spaces"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L338-L349 | train | 60,353 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.error_uns | def error_uns(self):
"""Check if package supported by arch
before proceed to install
"""
self.FAULT = ""
UNST = ["UNSUPPORTED", "UNTESTED"]
if "".join(self.source_dwn) in UNST:
self.FAULT = "".join(self.source_dwn) | python | def error_uns(self):
"""Check if package supported by arch
before proceed to install
"""
self.FAULT = ""
UNST = ["UNSUPPORTED", "UNTESTED"]
if "".join(self.source_dwn) in UNST:
self.FAULT = "".join(self.source_dwn) | [
"def",
"error_uns",
"(",
"self",
")",
":",
"self",
".",
"FAULT",
"=",
"\"\"",
"UNST",
"=",
"[",
"\"UNSUPPORTED\"",
",",
"\"UNTESTED\"",
"]",
"if",
"\"\"",
".",
"join",
"(",
"self",
".",
"source_dwn",
")",
"in",
"UNST",
":",
"self",
".",
"FAULT",
"=",... | Check if package supported by arch
before proceed to install | [
"Check",
"if",
"package",
"supported",
"by",
"arch",
"before",
"proceed",
"to",
"install"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L351-L358 | train | 60,354 |
dslackw/slpkg | slpkg/sbo/network.py | SBoNetwork.build | def build(self):
"""Only build and create Slackware package
"""
pkg_security([self.name])
self.error_uns()
if self.FAULT:
print("")
self.msg.template(78)
print("| Package {0} {1} {2} {3}".format(self.prgnam, self.red,
... | python | def build(self):
"""Only build and create Slackware package
"""
pkg_security([self.name])
self.error_uns()
if self.FAULT:
print("")
self.msg.template(78)
print("| Package {0} {1} {2} {3}".format(self.prgnam, self.red,
... | [
"def",
"build",
"(",
"self",
")",
":",
"pkg_security",
"(",
"[",
"self",
".",
"name",
"]",
")",
"self",
".",
"error_uns",
"(",
")",
"if",
"self",
".",
"FAULT",
":",
"print",
"(",
"\"\"",
")",
"self",
".",
"msg",
".",
"template",
"(",
"78",
")",
... | Only build and create Slackware package | [
"Only",
"build",
"and",
"create",
"Slackware",
"package"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/network.py#L360-L386 | train | 60,355 |
dslackw/slpkg | slpkg/sbo/queue.py | QueuePkgs.listed | def listed(self):
"""Print packages from queue
"""
print("\nPackages in the queue:\n")
for pkg in self.packages():
if pkg:
print("{0}{1}{2}".format(self.meta.color["GREEN"], pkg,
self.meta.color["ENDC"]))
... | python | def listed(self):
"""Print packages from queue
"""
print("\nPackages in the queue:\n")
for pkg in self.packages():
if pkg:
print("{0}{1}{2}".format(self.meta.color["GREEN"], pkg,
self.meta.color["ENDC"]))
... | [
"def",
"listed",
"(",
"self",
")",
":",
"print",
"(",
"\"\\nPackages in the queue:\\n\"",
")",
"for",
"pkg",
"in",
"self",
".",
"packages",
"(",
")",
":",
"if",
"pkg",
":",
"print",
"(",
"\"{0}{1}{2}\"",
".",
"format",
"(",
"self",
".",
"meta",
".",
"c... | Print packages from queue | [
"Print",
"packages",
"from",
"queue"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/queue.py#L79-L89 | train | 60,356 |
dslackw/slpkg | slpkg/sbo/queue.py | QueuePkgs.add | def add(self, pkgs):
"""Add packages in queue if not exist
"""
queue_list = self.packages()
pkgs = list(OrderedDict.fromkeys(pkgs))
print("\nAdd packages in the queue:\n")
with open(self.queue_list, "a") as queue:
for pkg in pkgs:
find = sbo_se... | python | def add(self, pkgs):
"""Add packages in queue if not exist
"""
queue_list = self.packages()
pkgs = list(OrderedDict.fromkeys(pkgs))
print("\nAdd packages in the queue:\n")
with open(self.queue_list, "a") as queue:
for pkg in pkgs:
find = sbo_se... | [
"def",
"add",
"(",
"self",
",",
"pkgs",
")",
":",
"queue_list",
"=",
"self",
".",
"packages",
"(",
")",
"pkgs",
"=",
"list",
"(",
"OrderedDict",
".",
"fromkeys",
"(",
"pkgs",
")",
")",
"print",
"(",
"\"\\nAdd packages in the queue:\\n\"",
")",
"with",
"o... | Add packages in queue if not exist | [
"Add",
"packages",
"in",
"queue",
"if",
"not",
"exist"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/queue.py#L91-L111 | train | 60,357 |
dslackw/slpkg | slpkg/sbo/queue.py | QueuePkgs.remove | def remove(self, pkgs):
"""Remove packages from queue
"""
print("\nRemove packages from the queue:\n")
with open(self.queue_list, "w") as queue:
for line in self.queued.splitlines():
if line not in pkgs:
queue.write(line + "\n")
... | python | def remove(self, pkgs):
"""Remove packages from queue
"""
print("\nRemove packages from the queue:\n")
with open(self.queue_list, "w") as queue:
for line in self.queued.splitlines():
if line not in pkgs:
queue.write(line + "\n")
... | [
"def",
"remove",
"(",
"self",
",",
"pkgs",
")",
":",
"print",
"(",
"\"\\nRemove packages from the queue:\\n\"",
")",
"with",
"open",
"(",
"self",
".",
"queue_list",
",",
"\"w\"",
")",
"as",
"queue",
":",
"for",
"line",
"in",
"self",
".",
"queued",
".",
"... | Remove packages from queue | [
"Remove",
"packages",
"from",
"queue"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/queue.py#L113-L127 | train | 60,358 |
dslackw/slpkg | slpkg/sbo/queue.py | QueuePkgs.build | def build(self):
"""Build packages from queue
"""
packages = self.packages()
if packages:
for pkg in packages:
if not os.path.exists(self.meta.build_path):
os.mkdir(self.meta.build_path)
if not os.path.exists(self._SOURCES):... | python | def build(self):
"""Build packages from queue
"""
packages = self.packages()
if packages:
for pkg in packages:
if not os.path.exists(self.meta.build_path):
os.mkdir(self.meta.build_path)
if not os.path.exists(self._SOURCES):... | [
"def",
"build",
"(",
"self",
")",
":",
"packages",
"=",
"self",
".",
"packages",
"(",
")",
"if",
"packages",
":",
"for",
"pkg",
"in",
"packages",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"meta",
".",
"build_path",
")",
... | Build packages from queue | [
"Build",
"packages",
"from",
"queue"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/queue.py#L129-L154 | train | 60,359 |
dslackw/slpkg | slpkg/sbo/queue.py | QueuePkgs.install | def install(self):
"""Install packages from queue
"""
packages = self.packages()
if packages:
print("") # new line at start
for pkg in packages:
ver = SBoGrep(pkg).version()
prgnam = "{0}-{1}".format(pkg, ver)
if f... | python | def install(self):
"""Install packages from queue
"""
packages = self.packages()
if packages:
print("") # new line at start
for pkg in packages:
ver = SBoGrep(pkg).version()
prgnam = "{0}-{1}".format(pkg, ver)
if f... | [
"def",
"install",
"(",
"self",
")",
":",
"packages",
"=",
"self",
".",
"packages",
"(",
")",
"if",
"packages",
":",
"print",
"(",
"\"\"",
")",
"# new line at start",
"for",
"pkg",
"in",
"packages",
":",
"ver",
"=",
"SBoGrep",
"(",
"pkg",
")",
".",
"v... | Install packages from queue | [
"Install",
"packages",
"from",
"queue"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/queue.py#L156-L173 | train | 60,360 |
dslackw/slpkg | slpkg/binary/check.py | pkg_upgrade | def pkg_upgrade(repo, skip, flag):
"""Checking packages for upgrade
"""
Msg().checking()
PACKAGES_TXT = RepoInit(repo).fetch()[0]
pkgs_for_upgrade = []
# name = data[0]
# location = data[1]
# size = data[2]
# unsize = data[3]
data = repo_data(PACKAGES_TXT, repo, flag="")
for ... | python | def pkg_upgrade(repo, skip, flag):
"""Checking packages for upgrade
"""
Msg().checking()
PACKAGES_TXT = RepoInit(repo).fetch()[0]
pkgs_for_upgrade = []
# name = data[0]
# location = data[1]
# size = data[2]
# unsize = data[3]
data = repo_data(PACKAGES_TXT, repo, flag="")
for ... | [
"def",
"pkg_upgrade",
"(",
"repo",
",",
"skip",
",",
"flag",
")",
":",
"Msg",
"(",
")",
".",
"checking",
"(",
")",
"PACKAGES_TXT",
"=",
"RepoInit",
"(",
"repo",
")",
".",
"fetch",
"(",
")",
"[",
"0",
"]",
"pkgs_for_upgrade",
"=",
"[",
"]",
"# name ... | Checking packages for upgrade | [
"Checking",
"packages",
"for",
"upgrade"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/binary/check.py#L39-L65 | train | 60,361 |
dslackw/slpkg | slpkg/splitting.py | split_package | def split_package(package):
"""
Split package in name, version
arch and build tag.
"""
name = ver = arch = build = []
split = package.split("-")
if len(split) > 2:
build = split[-1]
build_a, build_b = "", ""
build_a = build[:1]
if build[1:2].isdigit():
... | python | def split_package(package):
"""
Split package in name, version
arch and build tag.
"""
name = ver = arch = build = []
split = package.split("-")
if len(split) > 2:
build = split[-1]
build_a, build_b = "", ""
build_a = build[:1]
if build[1:2].isdigit():
... | [
"def",
"split_package",
"(",
"package",
")",
":",
"name",
"=",
"ver",
"=",
"arch",
"=",
"build",
"=",
"[",
"]",
"split",
"=",
"package",
".",
"split",
"(",
"\"-\"",
")",
"if",
"len",
"(",
"split",
")",
">",
"2",
":",
"build",
"=",
"split",
"[",
... | Split package in name, version
arch and build tag. | [
"Split",
"package",
"in",
"name",
"version",
"arch",
"and",
"build",
"tag",
"."
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/splitting.py#L25-L42 | train | 60,362 |
dslackw/slpkg | slpkg/__metadata__.py | remove_repositories | def remove_repositories(repositories, default_repositories):
"""
Remove no default repositories
"""
repos = []
for repo in repositories:
if repo in default_repositories:
repos.append(repo)
return repos | python | def remove_repositories(repositories, default_repositories):
"""
Remove no default repositories
"""
repos = []
for repo in repositories:
if repo in default_repositories:
repos.append(repo)
return repos | [
"def",
"remove_repositories",
"(",
"repositories",
",",
"default_repositories",
")",
":",
"repos",
"=",
"[",
"]",
"for",
"repo",
"in",
"repositories",
":",
"if",
"repo",
"in",
"default_repositories",
":",
"repos",
".",
"append",
"(",
"repo",
")",
"return",
"... | Remove no default repositories | [
"Remove",
"no",
"default",
"repositories"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/__metadata__.py#L28-L36 | train | 60,363 |
dslackw/slpkg | slpkg/__metadata__.py | update_repositories | def update_repositories(repositories, conf_path):
"""
Upadate with user custom repositories
"""
repo_file = "{0}custom-repositories".format(conf_path)
if os.path.isfile(repo_file):
f = open(repo_file, "r")
repositories_list = f.read()
f.close()
for line in repositorie... | python | def update_repositories(repositories, conf_path):
"""
Upadate with user custom repositories
"""
repo_file = "{0}custom-repositories".format(conf_path)
if os.path.isfile(repo_file):
f = open(repo_file, "r")
repositories_list = f.read()
f.close()
for line in repositorie... | [
"def",
"update_repositories",
"(",
"repositories",
",",
"conf_path",
")",
":",
"repo_file",
"=",
"\"{0}custom-repositories\"",
".",
"format",
"(",
"conf_path",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"repo_file",
")",
":",
"f",
"=",
"open",
"(",
... | Upadate with user custom repositories | [
"Upadate",
"with",
"user",
"custom",
"repositories"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/__metadata__.py#L39-L52 | train | 60,364 |
dslackw/slpkg | slpkg/sbo/greps.py | SBoGrep.names | def names(self):
"""Grab all packages name
"""
pkg_names = []
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
pkg_names.append(line[17:].strip())
return pkg_names | python | def names(self):
"""Grab all packages name
"""
pkg_names = []
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
pkg_names.append(line[17:].strip())
return pkg_names | [
"def",
"names",
"(",
"self",
")",
":",
"pkg_names",
"=",
"[",
"]",
"for",
"line",
"in",
"self",
".",
"SLACKBUILDS_TXT",
".",
"splitlines",
"(",
")",
":",
"if",
"line",
".",
"startswith",
"(",
"self",
".",
"line_name",
")",
":",
"pkg_names",
".",
"app... | Grab all packages name | [
"Grab",
"all",
"packages",
"name"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/greps.py#L50-L57 | train | 60,365 |
dslackw/slpkg | slpkg/sbo/greps.py | SBoGrep.source | def source(self):
"""Grab sources downloads links
"""
source, source64, = "", ""
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_down):
if ... | python | def source(self):
"""Grab sources downloads links
"""
source, source64, = "", ""
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_down):
if ... | [
"def",
"source",
"(",
"self",
")",
":",
"source",
",",
"source64",
",",
"=",
"\"\"",
",",
"\"\"",
"for",
"line",
"in",
"self",
".",
"SLACKBUILDS_TXT",
".",
"splitlines",
"(",
")",
":",
"if",
"line",
".",
"startswith",
"(",
"self",
".",
"line_name",
"... | Grab sources downloads links | [
"Grab",
"sources",
"downloads",
"links"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/greps.py#L59-L72 | train | 60,366 |
dslackw/slpkg | slpkg/sbo/greps.py | SBoGrep._select_source_arch | def _select_source_arch(self, source, source64):
"""Return sources by arch
"""
src = ""
if self.meta.arch == "x86_64":
if source64:
src = source64
else:
src = source
if self.meta.skip_unst in self.answer and source64 in ... | python | def _select_source_arch(self, source, source64):
"""Return sources by arch
"""
src = ""
if self.meta.arch == "x86_64":
if source64:
src = source64
else:
src = source
if self.meta.skip_unst in self.answer and source64 in ... | [
"def",
"_select_source_arch",
"(",
"self",
",",
"source",
",",
"source64",
")",
":",
"src",
"=",
"\"\"",
"if",
"self",
".",
"meta",
".",
"arch",
"==",
"\"x86_64\"",
":",
"if",
"source64",
":",
"src",
"=",
"source64",
"else",
":",
"src",
"=",
"source",
... | Return sources by arch | [
"Return",
"sources",
"by",
"arch"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/greps.py#L74-L90 | train | 60,367 |
dslackw/slpkg | slpkg/sbo/greps.py | SBoGrep.requires | def requires(self):
"""Grab package requirements
"""
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_req):
if sbo_name == self.name:
... | python | def requires(self):
"""Grab package requirements
"""
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_req):
if sbo_name == self.name:
... | [
"def",
"requires",
"(",
"self",
")",
":",
"for",
"line",
"in",
"self",
".",
"SLACKBUILDS_TXT",
".",
"splitlines",
"(",
")",
":",
"if",
"line",
".",
"startswith",
"(",
"self",
".",
"line_name",
")",
":",
"sbo_name",
"=",
"line",
"[",
"17",
":",
"]",
... | Grab package requirements | [
"Grab",
"package",
"requirements"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/greps.py#L92-L100 | train | 60,368 |
dslackw/slpkg | slpkg/sbo/greps.py | SBoGrep.version | def version(self):
"""Grab package version
"""
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_ver):
if sbo_name == self.name:
... | python | def version(self):
"""Grab package version
"""
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_ver):
if sbo_name == self.name:
... | [
"def",
"version",
"(",
"self",
")",
":",
"for",
"line",
"in",
"self",
".",
"SLACKBUILDS_TXT",
".",
"splitlines",
"(",
")",
":",
"if",
"line",
".",
"startswith",
"(",
"self",
".",
"line_name",
")",
":",
"sbo_name",
"=",
"line",
"[",
"17",
":",
"]",
... | Grab package version | [
"Grab",
"package",
"version"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/greps.py#L102-L110 | train | 60,369 |
dslackw/slpkg | slpkg/sbo/greps.py | SBoGrep.checksum | def checksum(self):
"""Grab checksum string
"""
md5sum, md5sum64, = [], []
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_md5_64):
if sbo_... | python | def checksum(self):
"""Grab checksum string
"""
md5sum, md5sum64, = [], []
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_md5_64):
if sbo_... | [
"def",
"checksum",
"(",
"self",
")",
":",
"md5sum",
",",
"md5sum64",
",",
"=",
"[",
"]",
",",
"[",
"]",
"for",
"line",
"in",
"self",
".",
"SLACKBUILDS_TXT",
".",
"splitlines",
"(",
")",
":",
"if",
"line",
".",
"startswith",
"(",
"self",
".",
"line_... | Grab checksum string | [
"Grab",
"checksum",
"string"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/greps.py#L112-L125 | train | 60,370 |
dslackw/slpkg | slpkg/sbo/greps.py | SBoGrep._select_md5sum_arch | def _select_md5sum_arch(self, md5sum, md5sum64):
"""Return checksums by arch
"""
if md5sum and md5sum64:
if self.meta.arch == "x86_64":
return md5sum64
else:
return md5sum
if md5sum:
return md5sum
else:
... | python | def _select_md5sum_arch(self, md5sum, md5sum64):
"""Return checksums by arch
"""
if md5sum and md5sum64:
if self.meta.arch == "x86_64":
return md5sum64
else:
return md5sum
if md5sum:
return md5sum
else:
... | [
"def",
"_select_md5sum_arch",
"(",
"self",
",",
"md5sum",
",",
"md5sum64",
")",
":",
"if",
"md5sum",
"and",
"md5sum64",
":",
"if",
"self",
".",
"meta",
".",
"arch",
"==",
"\"x86_64\"",
":",
"return",
"md5sum64",
"else",
":",
"return",
"md5sum",
"if",
"md... | Return checksums by arch | [
"Return",
"checksums",
"by",
"arch"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/greps.py#L127-L138 | train | 60,371 |
dslackw/slpkg | slpkg/sbo/greps.py | SBoGrep.description | def description(self):
"""Grab package verion
"""
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_des):
if sbo_name == self.name:
... | python | def description(self):
"""Grab package verion
"""
for line in self.SLACKBUILDS_TXT.splitlines():
if line.startswith(self.line_name):
sbo_name = line[17:].strip()
if line.startswith(self.line_des):
if sbo_name == self.name:
... | [
"def",
"description",
"(",
"self",
")",
":",
"for",
"line",
"in",
"self",
".",
"SLACKBUILDS_TXT",
".",
"splitlines",
"(",
")",
":",
"if",
"line",
".",
"startswith",
"(",
"self",
".",
"line_name",
")",
":",
"sbo_name",
"=",
"line",
"[",
"17",
":",
"]"... | Grab package verion | [
"Grab",
"package",
"verion"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/greps.py#L140-L148 | train | 60,372 |
dslackw/slpkg | slpkg/init.py | check_exists_repositories | def check_exists_repositories(repo):
"""Checking if repositories exists by PACKAGES.TXT file
"""
pkg_list = "PACKAGES.TXT"
if repo == "sbo":
pkg_list = "SLACKBUILDS.TXT"
if check_for_local_repos(repo) is True:
pkg_list = "PACKAGES.TXT"
return ""
if not os.path.isfile("{0}... | python | def check_exists_repositories(repo):
"""Checking if repositories exists by PACKAGES.TXT file
"""
pkg_list = "PACKAGES.TXT"
if repo == "sbo":
pkg_list = "SLACKBUILDS.TXT"
if check_for_local_repos(repo) is True:
pkg_list = "PACKAGES.TXT"
return ""
if not os.path.isfile("{0}... | [
"def",
"check_exists_repositories",
"(",
"repo",
")",
":",
"pkg_list",
"=",
"\"PACKAGES.TXT\"",
"if",
"repo",
"==",
"\"sbo\"",
":",
"pkg_list",
"=",
"\"SLACKBUILDS.TXT\"",
"if",
"check_for_local_repos",
"(",
"repo",
")",
"is",
"True",
":",
"pkg_list",
"=",
"\"PA... | Checking if repositories exists by PACKAGES.TXT file | [
"Checking",
"if",
"repositories",
"exists",
"by",
"PACKAGES",
".",
"TXT",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/init.py#L792-L804 | train | 60,373 |
dslackw/slpkg | slpkg/init.py | check_for_local_repos | def check_for_local_repos(repo):
"""Check if repository is local
"""
repos_dict = Repo().default_repository()
if repo in repos_dict:
repo_url = repos_dict[repo]
if repo_url.startswith("file:///"):
return True | python | def check_for_local_repos(repo):
"""Check if repository is local
"""
repos_dict = Repo().default_repository()
if repo in repos_dict:
repo_url = repos_dict[repo]
if repo_url.startswith("file:///"):
return True | [
"def",
"check_for_local_repos",
"(",
"repo",
")",
":",
"repos_dict",
"=",
"Repo",
"(",
")",
".",
"default_repository",
"(",
")",
"if",
"repo",
"in",
"repos_dict",
":",
"repo_url",
"=",
"repos_dict",
"[",
"repo",
"]",
"if",
"repo_url",
".",
"startswith",
"(... | Check if repository is local | [
"Check",
"if",
"repository",
"is",
"local"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/init.py#L807-L814 | train | 60,374 |
dslackw/slpkg | slpkg/init.py | Initialization.slack | def slack(self):
"""Creating slack local libraries
"""
log = self.log_path + "slack/"
lib = self.lib_path + "slack_repo/"
repo_name = log[:-1].split("/")[-1]
lib_file = "PACKAGES.TXT"
# lst_file = ""
md5_file = "CHECKSUMS.md5"
log_file = "ChangeLog... | python | def slack(self):
"""Creating slack local libraries
"""
log = self.log_path + "slack/"
lib = self.lib_path + "slack_repo/"
repo_name = log[:-1].split("/")[-1]
lib_file = "PACKAGES.TXT"
# lst_file = ""
md5_file = "CHECKSUMS.md5"
log_file = "ChangeLog... | [
"def",
"slack",
"(",
"self",
")",
":",
"log",
"=",
"self",
".",
"log_path",
"+",
"\"slack/\"",
"lib",
"=",
"self",
".",
"lib_path",
"+",
"\"slack_repo/\"",
"repo_name",
"=",
"log",
"[",
":",
"-",
"1",
"]",
".",
"split",
"(",
"\"/\"",
")",
"[",
"-",... | Creating slack local libraries | [
"Creating",
"slack",
"local",
"libraries"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/init.py#L98-L147 | train | 60,375 |
dslackw/slpkg | slpkg/init.py | Initialization.conrad | def conrad(self):
"""Creating slackers local library
"""
repo = self.def_repos_dict["conrad"]
log = self.log_path + "conrad/"
lib = self.lib_path + "conrad_repo/"
repo_name = log[:-1].split("/")[-1]
lib_file = "PACKAGES.TXT"
# lst_file = ""
md5_fil... | python | def conrad(self):
"""Creating slackers local library
"""
repo = self.def_repos_dict["conrad"]
log = self.log_path + "conrad/"
lib = self.lib_path + "conrad_repo/"
repo_name = log[:-1].split("/")[-1]
lib_file = "PACKAGES.TXT"
# lst_file = ""
md5_fil... | [
"def",
"conrad",
"(",
"self",
")",
":",
"repo",
"=",
"self",
".",
"def_repos_dict",
"[",
"\"conrad\"",
"]",
"log",
"=",
"self",
".",
"log_path",
"+",
"\"conrad/\"",
"lib",
"=",
"self",
".",
"lib_path",
"+",
"\"conrad_repo/\"",
"repo_name",
"=",
"log",
"[... | Creating slackers local library | [
"Creating",
"slackers",
"local",
"library"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/init.py#L271-L296 | train | 60,376 |
dslackw/slpkg | slpkg/init.py | Initialization.remote | def remote(self, *args):
"""Remove and recreate files
"""
log_path = args[0]
ChangeLog_txt = args[1]
lib_path = args[2]
PACKAGES_TXT = args[3]
CHECKSUMS_MD5 = args[4]
FILELIST_TXT = args[5]
repo = args[6]
if self.checks_logs(log_path, Chan... | python | def remote(self, *args):
"""Remove and recreate files
"""
log_path = args[0]
ChangeLog_txt = args[1]
lib_path = args[2]
PACKAGES_TXT = args[3]
CHECKSUMS_MD5 = args[4]
FILELIST_TXT = args[5]
repo = args[6]
if self.checks_logs(log_path, Chan... | [
"def",
"remote",
"(",
"self",
",",
"*",
"args",
")",
":",
"log_path",
"=",
"args",
"[",
"0",
"]",
"ChangeLog_txt",
"=",
"args",
"[",
"1",
"]",
"lib_path",
"=",
"args",
"[",
"2",
"]",
"PACKAGES_TXT",
"=",
"args",
"[",
"3",
"]",
"CHECKSUMS_MD5",
"=",... | Remove and recreate files | [
"Remove",
"and",
"recreate",
"files"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/init.py#L666-L700 | train | 60,377 |
dslackw/slpkg | slpkg/init.py | Initialization.file_remove | def file_remove(self, path, filename):
"""Check if filename exists and remove
"""
if os.path.isfile(path + filename):
os.remove(path + filename) | python | def file_remove(self, path, filename):
"""Check if filename exists and remove
"""
if os.path.isfile(path + filename):
os.remove(path + filename) | [
"def",
"file_remove",
"(",
"self",
",",
"path",
",",
"filename",
")",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"path",
"+",
"filename",
")",
":",
"os",
".",
"remove",
"(",
"path",
"+",
"filename",
")"
] | Check if filename exists and remove | [
"Check",
"if",
"filename",
"exists",
"and",
"remove"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/init.py#L712-L716 | train | 60,378 |
dslackw/slpkg | slpkg/init.py | Initialization.checks_logs | def checks_logs(self, log_path, url):
"""Checks ChangeLog.txt for changes
"""
local = ""
filename = url.split("/")[-1]
server = FileSize(url).server()
if os.path.isfile(log_path + filename):
local = FileSize(log_path + filename).local()
if server != lo... | python | def checks_logs(self, log_path, url):
"""Checks ChangeLog.txt for changes
"""
local = ""
filename = url.split("/")[-1]
server = FileSize(url).server()
if os.path.isfile(log_path + filename):
local = FileSize(log_path + filename).local()
if server != lo... | [
"def",
"checks_logs",
"(",
"self",
",",
"log_path",
",",
"url",
")",
":",
"local",
"=",
"\"\"",
"filename",
"=",
"url",
".",
"split",
"(",
"\"/\"",
")",
"[",
"-",
"1",
"]",
"server",
"=",
"FileSize",
"(",
"url",
")",
".",
"server",
"(",
")",
"if"... | Checks ChangeLog.txt for changes | [
"Checks",
"ChangeLog",
".",
"txt",
"for",
"changes"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/init.py#L718-L728 | train | 60,379 |
dslackw/slpkg | slpkg/init.py | Initialization.upgrade | def upgrade(self, only):
"""Remove all package lists with changelog and checksums files
and create lists again"""
repositories = self.meta.repositories
if only:
repositories = only
for repo in repositories:
changelogs = "{0}{1}{2}".format(self.log_path, re... | python | def upgrade(self, only):
"""Remove all package lists with changelog and checksums files
and create lists again"""
repositories = self.meta.repositories
if only:
repositories = only
for repo in repositories:
changelogs = "{0}{1}{2}".format(self.log_path, re... | [
"def",
"upgrade",
"(",
"self",
",",
"only",
")",
":",
"repositories",
"=",
"self",
".",
"meta",
".",
"repositories",
"if",
"only",
":",
"repositories",
"=",
"only",
"for",
"repo",
"in",
"repositories",
":",
"changelogs",
"=",
"\"{0}{1}{2}\"",
".",
"format"... | Remove all package lists with changelog and checksums files
and create lists again | [
"Remove",
"all",
"package",
"lists",
"with",
"changelog",
"and",
"checksums",
"files",
"and",
"create",
"lists",
"again"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/init.py#L730-L749 | train | 60,380 |
dslackw/slpkg | slpkg/init.py | Update.repository | def repository(self, only):
"""Update repositories lists
"""
print("\nCheck and update repositories:\n")
default = self.meta.default_repositories
enabled = self.meta.repositories
if only:
enabled = only
for repo in enabled:
if check_for_loc... | python | def repository(self, only):
"""Update repositories lists
"""
print("\nCheck and update repositories:\n")
default = self.meta.default_repositories
enabled = self.meta.repositories
if only:
enabled = only
for repo in enabled:
if check_for_loc... | [
"def",
"repository",
"(",
"self",
",",
"only",
")",
":",
"print",
"(",
"\"\\nCheck and update repositories:\\n\"",
")",
"default",
"=",
"self",
".",
"meta",
".",
"default_repositories",
"enabled",
"=",
"self",
".",
"meta",
".",
"repositories",
"if",
"only",
":... | Update repositories lists | [
"Update",
"repositories",
"lists"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/init.py#L762-L789 | train | 60,381 |
dslackw/slpkg | slpkg/dialog_box.py | DialogUtil.checklist | def checklist(self):
"""Run dialog checklist
"""
choice = []
for item in self.data:
choice.append((item, "", self.status))
code, self.tags = self.d.checklist(
text=self.text, height=20, width=65, list_height=13,
choices=choice, title=self.title... | python | def checklist(self):
"""Run dialog checklist
"""
choice = []
for item in self.data:
choice.append((item, "", self.status))
code, self.tags = self.d.checklist(
text=self.text, height=20, width=65, list_height=13,
choices=choice, title=self.title... | [
"def",
"checklist",
"(",
"self",
")",
":",
"choice",
"=",
"[",
"]",
"for",
"item",
"in",
"self",
".",
"data",
":",
"choice",
".",
"append",
"(",
"(",
"item",
",",
"\"\"",
",",
"self",
".",
"status",
")",
")",
"code",
",",
"self",
".",
"tags",
"... | Run dialog checklist | [
"Run",
"dialog",
"checklist"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/dialog_box.py#L49-L62 | train | 60,382 |
dslackw/slpkg | slpkg/dialog_box.py | DialogUtil.buildlist | def buildlist(self, enabled):
"""Run dialog buildlist
"""
choice = []
for item in self.data:
choice.append((item, False))
for item in enabled:
choice.append((item, True))
items = [(tag, tag, sta) for (tag, sta) in choice]
code, self.tags = ... | python | def buildlist(self, enabled):
"""Run dialog buildlist
"""
choice = []
for item in self.data:
choice.append((item, False))
for item in enabled:
choice.append((item, True))
items = [(tag, tag, sta) for (tag, sta) in choice]
code, self.tags = ... | [
"def",
"buildlist",
"(",
"self",
",",
"enabled",
")",
":",
"choice",
"=",
"[",
"]",
"for",
"item",
"in",
"self",
".",
"data",
":",
"choice",
".",
"append",
"(",
"(",
"item",
",",
"False",
")",
")",
"for",
"item",
"in",
"enabled",
":",
"choice",
"... | Run dialog buildlist | [
"Run",
"dialog",
"buildlist"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/dialog_box.py#L64-L80 | train | 60,383 |
dslackw/slpkg | slpkg/dialog_box.py | DialogUtil.unicode_to_string | def unicode_to_string(self):
"""Convert unicode in string
"""
for tag in self.tags:
self.ununicode.append(str(tag)) | python | def unicode_to_string(self):
"""Convert unicode in string
"""
for tag in self.tags:
self.ununicode.append(str(tag)) | [
"def",
"unicode_to_string",
"(",
"self",
")",
":",
"for",
"tag",
"in",
"self",
".",
"tags",
":",
"self",
".",
"ununicode",
".",
"append",
"(",
"str",
"(",
"tag",
")",
")"
] | Convert unicode in string | [
"Convert",
"unicode",
"in",
"string"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/dialog_box.py#L93-L97 | train | 60,384 |
dslackw/slpkg | slpkg/sbo/check.py | sbo_upgrade | def sbo_upgrade(skip, flag):
"""Return packages for upgrade
"""
Msg().checking()
upgrade_names = []
data = SBoGrep(name="").names()
blacklist = BlackList().packages(pkgs=data, repo="sbo")
for pkg in sbo_list():
status(0.02)
name = split_package(pkg)[0]
ver = split_pac... | python | def sbo_upgrade(skip, flag):
"""Return packages for upgrade
"""
Msg().checking()
upgrade_names = []
data = SBoGrep(name="").names()
blacklist = BlackList().packages(pkgs=data, repo="sbo")
for pkg in sbo_list():
status(0.02)
name = split_package(pkg)[0]
ver = split_pac... | [
"def",
"sbo_upgrade",
"(",
"skip",
",",
"flag",
")",
":",
"Msg",
"(",
")",
".",
"checking",
"(",
")",
"upgrade_names",
"=",
"[",
"]",
"data",
"=",
"SBoGrep",
"(",
"name",
"=",
"\"\"",
")",
".",
"names",
"(",
")",
"blacklist",
"=",
"BlackList",
"(",... | Return packages for upgrade | [
"Return",
"packages",
"for",
"upgrade"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/check.py#L38-L57 | train | 60,385 |
dslackw/slpkg | slpkg/sbo/check.py | sbo_list | def sbo_list():
"""Return all SBo packages
"""
sbo_packages = []
for pkg in os.listdir(_meta_.pkg_path):
if pkg.endswith("_SBo"):
sbo_packages.append(pkg)
return sbo_packages | python | def sbo_list():
"""Return all SBo packages
"""
sbo_packages = []
for pkg in os.listdir(_meta_.pkg_path):
if pkg.endswith("_SBo"):
sbo_packages.append(pkg)
return sbo_packages | [
"def",
"sbo_list",
"(",
")",
":",
"sbo_packages",
"=",
"[",
"]",
"for",
"pkg",
"in",
"os",
".",
"listdir",
"(",
"_meta_",
".",
"pkg_path",
")",
":",
"if",
"pkg",
".",
"endswith",
"(",
"\"_SBo\"",
")",
":",
"sbo_packages",
".",
"append",
"(",
"pkg",
... | Return all SBo packages | [
"Return",
"all",
"SBo",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/check.py#L60-L67 | train | 60,386 |
dslackw/slpkg | slpkg/remove.py | delete_package | def delete_package(path, packages):
"""Remove downloaded packages
"""
if _meta_.del_all in ["on", "ON"]:
for pkg in packages:
os.remove(path + pkg) | python | def delete_package(path, packages):
"""Remove downloaded packages
"""
if _meta_.del_all in ["on", "ON"]:
for pkg in packages:
os.remove(path + pkg) | [
"def",
"delete_package",
"(",
"path",
",",
"packages",
")",
":",
"if",
"_meta_",
".",
"del_all",
"in",
"[",
"\"on\"",
",",
"\"ON\"",
"]",
":",
"for",
"pkg",
"in",
"packages",
":",
"os",
".",
"remove",
"(",
"path",
"+",
"pkg",
")"
] | Remove downloaded packages | [
"Remove",
"downloaded",
"packages"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/remove.py#L30-L35 | train | 60,387 |
dslackw/slpkg | slpkg/sbo/remove.py | delete | def delete(build_folder):
"""Delete build directory and all its contents.
"""
if _meta_.del_build in ["on", "ON"] and os.path.exists(build_folder):
shutil.rmtree(build_folder) | python | def delete(build_folder):
"""Delete build directory and all its contents.
"""
if _meta_.del_build in ["on", "ON"] and os.path.exists(build_folder):
shutil.rmtree(build_folder) | [
"def",
"delete",
"(",
"build_folder",
")",
":",
"if",
"_meta_",
".",
"del_build",
"in",
"[",
"\"on\"",
",",
"\"ON\"",
"]",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"build_folder",
")",
":",
"shutil",
".",
"rmtree",
"(",
"build_folder",
")"
] | Delete build directory and all its contents. | [
"Delete",
"build",
"directory",
"and",
"all",
"its",
"contents",
"."
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/sbo/remove.py#L31-L35 | train | 60,388 |
dslackw/slpkg | slpkg/slack/patches.py | Patches.start | def start(self):
"""
Install new patches from official Slackware mirrors
"""
self.store()
self.msg.done()
if self.upgrade_all:
if "--checklist" in self.flag:
self.dialog_checklist()
print("\nThese packages need upgrading:\n")
... | python | def start(self):
"""
Install new patches from official Slackware mirrors
"""
self.store()
self.msg.done()
if self.upgrade_all:
if "--checklist" in self.flag:
self.dialog_checklist()
print("\nThese packages need upgrading:\n")
... | [
"def",
"start",
"(",
"self",
")",
":",
"self",
".",
"store",
"(",
")",
"self",
".",
"msg",
".",
"done",
"(",
")",
"if",
"self",
".",
"upgrade_all",
":",
"if",
"\"--checklist\"",
"in",
"self",
".",
"flag",
":",
"self",
".",
"dialog_checklist",
"(",
... | Install new patches from official Slackware mirrors | [
"Install",
"new",
"patches",
"from",
"official",
"Slackware",
"mirrors"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/slack/patches.py#L81-L133 | train | 60,389 |
dslackw/slpkg | slpkg/slack/patches.py | Patches.store | def store(self):
"""
Store and return packages for upgrading
"""
data = repo_data(self.PACKAGES_TXT, "slack", self.flag)
black = BlackList().packages(pkgs=data[0], repo="slack")
for name, loc, comp, uncomp in zip(data[0], data[1], data[2], data[3]):
status(0.0... | python | def store(self):
"""
Store and return packages for upgrading
"""
data = repo_data(self.PACKAGES_TXT, "slack", self.flag)
black = BlackList().packages(pkgs=data[0], repo="slack")
for name, loc, comp, uncomp in zip(data[0], data[1], data[2], data[3]):
status(0.0... | [
"def",
"store",
"(",
"self",
")",
":",
"data",
"=",
"repo_data",
"(",
"self",
".",
"PACKAGES_TXT",
",",
"\"slack\"",
",",
"self",
".",
"flag",
")",
"black",
"=",
"BlackList",
"(",
")",
".",
"packages",
"(",
"pkgs",
"=",
"data",
"[",
"0",
"]",
",",
... | Store and return packages for upgrading | [
"Store",
"and",
"return",
"packages",
"for",
"upgrading"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/slack/patches.py#L135-L157 | train | 60,390 |
dslackw/slpkg | slpkg/slack/patches.py | Patches.kernel | def kernel(self):
"""
Check if kernel upgraded if true
then reinstall "lilo"
"""
for core in self.upgrade_all:
if "kernel" in core:
if self.meta.default_answer in ["y", "Y"]:
answer = self.meta.default_answer
else:
... | python | def kernel(self):
"""
Check if kernel upgraded if true
then reinstall "lilo"
"""
for core in self.upgrade_all:
if "kernel" in core:
if self.meta.default_answer in ["y", "Y"]:
answer = self.meta.default_answer
else:
... | [
"def",
"kernel",
"(",
"self",
")",
":",
"for",
"core",
"in",
"self",
".",
"upgrade_all",
":",
"if",
"\"kernel\"",
"in",
"core",
":",
"if",
"self",
".",
"meta",
".",
"default_answer",
"in",
"[",
"\"y\"",
",",
"\"Y\"",
"]",
":",
"answer",
"=",
"self",
... | Check if kernel upgraded if true
then reinstall "lilo" | [
"Check",
"if",
"kernel",
"upgraded",
"if",
"true",
"then",
"reinstall",
"lilo"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/slack/patches.py#L230-L254 | train | 60,391 |
dslackw/slpkg | slpkg/slack/patches.py | Patches.slackpkg_update | def slackpkg_update(self):
"""This replace slackpkg ChangeLog.txt file with new
from Slackware official mirrors after update distribution.
"""
NEW_ChangeLog_txt = URL(mirrors("ChangeLog.txt", "")).reading()
if os.path.isfile(self.meta.slackpkg_lib_path + "ChangeLog.txt.old"):
... | python | def slackpkg_update(self):
"""This replace slackpkg ChangeLog.txt file with new
from Slackware official mirrors after update distribution.
"""
NEW_ChangeLog_txt = URL(mirrors("ChangeLog.txt", "")).reading()
if os.path.isfile(self.meta.slackpkg_lib_path + "ChangeLog.txt.old"):
... | [
"def",
"slackpkg_update",
"(",
"self",
")",
":",
"NEW_ChangeLog_txt",
"=",
"URL",
"(",
"mirrors",
"(",
"\"ChangeLog.txt\"",
",",
"\"\"",
")",
")",
".",
"reading",
"(",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"self",
".",
"meta",
".",
"slackpk... | This replace slackpkg ChangeLog.txt file with new
from Slackware official mirrors after update distribution. | [
"This",
"replace",
"slackpkg",
"ChangeLog",
".",
"txt",
"file",
"with",
"new",
"from",
"Slackware",
"official",
"mirrors",
"after",
"update",
"distribution",
"."
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/slack/patches.py#L256-L269 | train | 60,392 |
dslackw/slpkg | slpkg/slack/patches.py | Patches.update_lists | def update_lists(self):
"""Update packages list and ChangeLog.txt file after
upgrade distribution
"""
print("{0}Update the package lists ?{1}".format(
self.meta.color["GREEN"], self.meta.color["ENDC"]))
print("=" * 79)
if self.msg.answer() in ["y", "Y"]:
... | python | def update_lists(self):
"""Update packages list and ChangeLog.txt file after
upgrade distribution
"""
print("{0}Update the package lists ?{1}".format(
self.meta.color["GREEN"], self.meta.color["ENDC"]))
print("=" * 79)
if self.msg.answer() in ["y", "Y"]:
... | [
"def",
"update_lists",
"(",
"self",
")",
":",
"print",
"(",
"\"{0}Update the package lists ?{1}\"",
".",
"format",
"(",
"self",
".",
"meta",
".",
"color",
"[",
"\"GREEN\"",
"]",
",",
"self",
".",
"meta",
".",
"color",
"[",
"\"ENDC\"",
"]",
")",
")",
"pri... | Update packages list and ChangeLog.txt file after
upgrade distribution | [
"Update",
"packages",
"list",
"and",
"ChangeLog",
".",
"txt",
"file",
"after",
"upgrade",
"distribution"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/slack/patches.py#L271-L279 | train | 60,393 |
dslackw/slpkg | slpkg/pkg/build.py | log_head | def log_head(path, log_file, log_time):
"""
write headers to log file
"""
with open(path + log_file, "w") as log:
log.write("#" * 79 + "\n\n")
log.write("File : " + log_file + "\n")
log.write("Path : " + path + "\n")
log.write("Date : " + time.strftime("%d/%m/%Y") + "\n")... | python | def log_head(path, log_file, log_time):
"""
write headers to log file
"""
with open(path + log_file, "w") as log:
log.write("#" * 79 + "\n\n")
log.write("File : " + log_file + "\n")
log.write("Path : " + path + "\n")
log.write("Date : " + time.strftime("%d/%m/%Y") + "\n")... | [
"def",
"log_head",
"(",
"path",
",",
"log_file",
",",
"log_time",
")",
":",
"with",
"open",
"(",
"path",
"+",
"log_file",
",",
"\"w\"",
")",
"as",
"log",
":",
"log",
".",
"write",
"(",
"\"#\"",
"*",
"79",
"+",
"\"\\n\\n\"",
")",
"log",
".",
"write"... | write headers to log file | [
"write",
"headers",
"to",
"log",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/pkg/build.py#L159-L170 | train | 60,394 |
dslackw/slpkg | slpkg/pkg/build.py | log_end | def log_end(path, log_file, sum_time):
"""
append END tag to a log file
"""
with open(path + log_file, "a") as log:
log.seek(2)
log.write("#" * 79 + "\n\n")
log.write("Time : " + time.strftime("%H:%M:%S") + "\n")
log.write("Total build time : {0}\n".format(sum_time))
... | python | def log_end(path, log_file, sum_time):
"""
append END tag to a log file
"""
with open(path + log_file, "a") as log:
log.seek(2)
log.write("#" * 79 + "\n\n")
log.write("Time : " + time.strftime("%H:%M:%S") + "\n")
log.write("Total build time : {0}\n".format(sum_time))
... | [
"def",
"log_end",
"(",
"path",
",",
"log_file",
",",
"sum_time",
")",
":",
"with",
"open",
"(",
"path",
"+",
"log_file",
",",
"\"a\"",
")",
"as",
"log",
":",
"log",
".",
"seek",
"(",
"2",
")",
"log",
".",
"write",
"(",
"\"#\"",
"*",
"79",
"+",
... | append END tag to a log file | [
"append",
"END",
"tag",
"to",
"a",
"log",
"file"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/pkg/build.py#L173-L184 | train | 60,395 |
dslackw/slpkg | slpkg/pkg/build.py | build_time | def build_time(start_time):
"""
Calculate build time per package
"""
diff_time = round(time.time() - start_time, 2)
if diff_time <= 59.99:
sum_time = str(diff_time) + " Sec"
elif diff_time > 59.99 and diff_time <= 3599.99:
sum_time = round(diff_time / 60, 2)
sum_time_list... | python | def build_time(start_time):
"""
Calculate build time per package
"""
diff_time = round(time.time() - start_time, 2)
if diff_time <= 59.99:
sum_time = str(diff_time) + " Sec"
elif diff_time > 59.99 and diff_time <= 3599.99:
sum_time = round(diff_time / 60, 2)
sum_time_list... | [
"def",
"build_time",
"(",
"start_time",
")",
":",
"diff_time",
"=",
"round",
"(",
"time",
".",
"time",
"(",
")",
"-",
"start_time",
",",
"2",
")",
"if",
"diff_time",
"<=",
"59.99",
":",
"sum_time",
"=",
"str",
"(",
"diff_time",
")",
"+",
"\" Sec\"",
... | Calculate build time per package | [
"Calculate",
"build",
"time",
"per",
"package"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/pkg/build.py#L187-L204 | train | 60,396 |
dslackw/slpkg | slpkg/pkg/build.py | BuildPackage._create_md5_dict | def _create_md5_dict(self):
"""Create md5 dictionary per source
"""
self.sbo_md5 = {}
md5_lists = SBoGrep(self.prgnam).checksum()
for src, md5 in zip(self.sources, md5_lists):
self.sbo_md5[src] = md5 | python | def _create_md5_dict(self):
"""Create md5 dictionary per source
"""
self.sbo_md5 = {}
md5_lists = SBoGrep(self.prgnam).checksum()
for src, md5 in zip(self.sources, md5_lists):
self.sbo_md5[src] = md5 | [
"def",
"_create_md5_dict",
"(",
"self",
")",
":",
"self",
".",
"sbo_md5",
"=",
"{",
"}",
"md5_lists",
"=",
"SBoGrep",
"(",
"self",
".",
"prgnam",
")",
".",
"checksum",
"(",
")",
"for",
"src",
",",
"md5",
"in",
"zip",
"(",
"self",
".",
"sources",
",... | Create md5 dictionary per source | [
"Create",
"md5",
"dictionary",
"per",
"source"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/pkg/build.py#L120-L126 | train | 60,397 |
dslackw/slpkg | slpkg/pkg/build.py | BuildPackage._makeflags | def _makeflags(self):
"""Set variable MAKEFLAGS with the numbers of
processors
"""
if self.meta.makeflags in ["on", "ON"]:
cpus = multiprocessing.cpu_count()
os.environ["MAKEFLAGS"] = "-j{0}".format(cpus) | python | def _makeflags(self):
"""Set variable MAKEFLAGS with the numbers of
processors
"""
if self.meta.makeflags in ["on", "ON"]:
cpus = multiprocessing.cpu_count()
os.environ["MAKEFLAGS"] = "-j{0}".format(cpus) | [
"def",
"_makeflags",
"(",
"self",
")",
":",
"if",
"self",
".",
"meta",
".",
"makeflags",
"in",
"[",
"\"on\"",
",",
"\"ON\"",
"]",
":",
"cpus",
"=",
"multiprocessing",
".",
"cpu_count",
"(",
")",
"os",
".",
"environ",
"[",
"\"MAKEFLAGS\"",
"]",
"=",
"... | Set variable MAKEFLAGS with the numbers of
processors | [
"Set",
"variable",
"MAKEFLAGS",
"with",
"the",
"numbers",
"of",
"processors"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/pkg/build.py#L128-L134 | train | 60,398 |
dslackw/slpkg | slpkg/pkg/build.py | BuildPackage._pass_variable | def _pass_variable(self):
"""Return enviroment variables
"""
pass_var = []
for var in os.environ.keys():
expVAR = var.split("_")
if expVAR[0] == self.prgnam.upper() and expVAR[1] != "PATH":
pass_var.append("{0}={1}".format(expVAR[1], os.environ[var... | python | def _pass_variable(self):
"""Return enviroment variables
"""
pass_var = []
for var in os.environ.keys():
expVAR = var.split("_")
if expVAR[0] == self.prgnam.upper() and expVAR[1] != "PATH":
pass_var.append("{0}={1}".format(expVAR[1], os.environ[var... | [
"def",
"_pass_variable",
"(",
"self",
")",
":",
"pass_var",
"=",
"[",
"]",
"for",
"var",
"in",
"os",
".",
"environ",
".",
"keys",
"(",
")",
":",
"expVAR",
"=",
"var",
".",
"split",
"(",
"\"_\"",
")",
"if",
"expVAR",
"[",
"0",
"]",
"==",
"self",
... | Return enviroment variables | [
"Return",
"enviroment",
"variables"
] | dd2e08a80e944d337d157b992167ba631a4343de | https://github.com/dslackw/slpkg/blob/dd2e08a80e944d337d157b992167ba631a4343de/slpkg/pkg/build.py#L136-L144 | train | 60,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.