本文整理汇总了Python中slpkg.messages.Msg类的典型用法代码示例。如果您正苦于以下问题:Python Msg类的具体用法?Python Msg怎么用?Python Msg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Msg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, args):
self.args = args
self.meta = _meta_
self.msg = Msg()
self.commands = [
"update",
"upgrade",
"repo-add",
"repo-remove",
"repo-enable",
"repo-list",
"repo-info",
"update-slpkg",
"health",
"deps-status",
"new-config"
]
# checking if repositories exists
if len(self.args) > 1 and self.args[0] not in [
"-h", "--help", "-v", "--version", "upgrade", "repo-enable",
"repo-list", "repo-add", "repo-remove", "update", "update-slpkg",
"health", "-g", "--config"
]:
check_exists_repositories()
示例2: __init__
def __init__(self, slackbuilds, flag):
self.slackbuilds = slackbuilds
self.flag = flag
self.meta = _meta_
self.msg = Msg()
self.arch = SBoArch().get()
self.build_folder = self.meta.build_path
for fl in self.flag:
if fl.startswith("--directory-prefix="):
self.build_folder = fl.split("=")[1]
if not self.build_folder.endswith("/"):
self.build_folder += "/"
self.unst = ["UNSUPPORTED", "UNTESTED"]
self.master_packages = []
self.deps = []
self.dependencies = []
self.package_not_found = []
self.package_found = []
self.deps_dict = {}
self.answer = ""
self.match = False
self.count_ins = 0
self.count_upg = 0
self.count_uni = 0
self.msg.reading()
self.data = SBoGrep(name="").names()
self.blacklist = BlackList().packages(pkgs=self.data, repo="sbo")
示例3: __init__
def __init__(self, mode):
self.mode = mode
self.meta = _meta_
self.msg = Msg()
self.pkg_path = _meta_.pkg_path
self.installed = []
self.cn = 0
示例4: __init__
def __init__(self, binary):
self.binary = binary
self.meta = _meta_
self.msg = Msg()
self.skip = []
self.size = 0
self.unit = "Kb"
示例5: __init__
def __init__(self, repo):
self.repo = repo
self.meta = _meta_
self.msg = Msg()
self.check = 2
self.st = ""
self.count_repo = 0
self.count_news = 0
self._init = Initialization(True)
self.all_repos = {
"slack": self._init.slack,
"sbo": self._init.sbo,
"rlw": self._init.rlw,
"alien": self._init.alien,
"slacky": self._init.slacky,
"studio": self._init.studio,
"slackr": self._init.slackr,
"slonly": self._init.slonly,
"ktown": self._init.ktown,
"multi": self._init.multi,
"slacke": self._init.slacke,
"salix": self._init.salix,
"slackl": self._init.slackl,
"rested": self._init.rested,
"msb": self._init.msb
}
示例6: __init__
def __init__(self, packages, repo, flag):
self.packages = packages
pkg_security(packages)
self.repo = repo
self.flag = flag
self.meta = _meta_
self.msg = Msg()
self.version = self.meta.slack_rel
self.tmp_path = self.meta.slpkg_tmp_packages
for fl in self.flag:
if fl.startswith("--directory-prefix="):
self.tmp_path = fl.split("=")[1]
if not self.tmp_path.endswith("/"):
self.tmp_path += "/"
self.dwn, self.dep_dwn = [], []
self.install, self.dep_install = [], []
self.comp_sum, self.dep_comp_sum = [], []
self.uncomp_sum, self.dep_uncomp_sum = [], []
self.dependencies = []
self.deps_dict = {}
self.answer = ""
self.msg.reading()
self.PACKAGES_TXT, self.mirror = RepoInit(self.repo).fetch()
self.data = repo_data(self.PACKAGES_TXT, self.repo, self.flag)
self.repo_pkg_names = []
for name in self.data[0]:
self.repo_pkg_names.append(split_package(name)[0])
self.blacklist = BlackList().packages(self.data[0], self.repo)
self.matching = False
示例7: __init__
def __init__(self, name, flag):
self.name = name
self.flag = flag
self.meta = _meta_
self.msg = Msg()
self.arch = SBoArch().get()
self.comp_tar = ".tar.gz"
self.choice = ""
self.FAULT = ""
self.green = self.meta.color["GREEN"]
self.red = self.meta.color["RED"]
self.yellow = self.meta.color["YELLOW"]
self.cyan = self.meta.color["CYAN"]
self.grey = self.meta.color["GREY"]
self.endc = self.meta.color["ENDC"]
self.build_folder = self.meta.build_path
self._SOURCES = self.meta._SBo_SOURCES
self.msg.reading()
self.data = SBoGrep(name="").names()
self.case_insensitive()
if "--checklist" in self.flag:
self.with_checklist()
grep = SBoGrep(self.name)
self.sbo_files = grep.files()
self.blacklist = BlackList().packages(pkgs=self.data, repo="sbo")
self.sbo_url = sbo_search_pkg(self.name)
if self.sbo_url:
self.sbo_desc = grep.description()[len(self.name) + 2:-1]
self.source_dwn = grep.source().split()
self.sbo_req = grep.requires()
self.sbo_dwn = SBoLink(self.sbo_url).tar_gz()
self.sbo_version = grep.version()
self.dwn_srcs = self.sbo_dwn.split() + self.source_dwn
if "--checklist" not in self.flag or not self.sbo_url and self.name:
self.msg.done()
示例8: PkgDesc
class PkgDesc(object):
"""Print package description from the repository
"""
def __init__(self, name, repo, paint):
self.name = name
self.repo = repo
self.paint = paint
self.meta = _meta_
self.msg = Msg()
self.COLOR = ""
self.lib = ""
color_text = {
"red": self.meta.color["RED"],
"green": self.meta.color["GREEN"],
"yellow": self.meta.color["YELLOW"],
"cyan": self.meta.color["CYAN"],
"grey": self.meta.color["GREY"],
"": ""
}
self.COLOR = color_text[self.paint]
if self.repo in self.meta.repositories and self.repo != "sbo":
self.lib = self.meta.lib_path + "{0}_repo/PACKAGES.TXT".format(
self.repo)
def view(self):
"""Print package description by repository
"""
print("") # new line at start
description, count = "", 0
if self.repo == "sbo":
description = SBoGrep(self.name).description()
else:
PACKAGES_TXT = Utils().read_file(self.lib)
for line in PACKAGES_TXT.splitlines():
if line.startswith(self.name + ":"):
description += line[len(self.name) + 2:] + "\n"
count += 1
if count == 11:
break
if description:
print("{0}{1}{2}".format(self.COLOR, description,
self.meta.color["ENDC"]))
else:
self.msg.pkg_not_found("", self.name, "No matching", "\n")
raise SystemExit(1)
if description and self.repo == "sbo":
print("")
示例9: RepoList
class RepoList(object):
"""List of repositories
"""
def __init__(self):
self.meta = _meta_
self.msg = Msg()
self.all_repos = Repo().default_repository()
self.all_repos["slack"] = Repo().slack()
self.all_repos.update(Repo().custom_repository())
def repos(self):
"""View or enabled or disabled repositories
"""
def_cnt, cus_cnt = 0, 0
print("")
self.msg.template(78)
print("{0}{1}{2}{3}{4}{5}{6}".format(
"| Repo id", " " * 2,
"Repo URL", " " * 44,
"Default", " " * 3,
"Status"))
self.msg.template(78)
for repo_id, repo_URL in sorted(self.all_repos.iteritems()):
status, COLOR = "disabled", self.meta.color["RED"]
default = "yes"
if len(repo_URL) > 49:
repo_URL = repo_URL[:48] + "~"
if repo_id in self.meta.repositories:
def_cnt += 1
status, COLOR = "enabled", self.meta.color["GREEN"]
if repo_id not in self.meta.default_repositories:
cus_cnt += 1
default = "no"
print(" {0}{1}{2}{3}{4}{5}{6}{7:>8}{8}".format(
repo_id, " " * (9 - len(repo_id)),
repo_URL, " " * (52 - len(repo_URL)),
default, " " * (8 - len(default)),
COLOR, status, self.meta.color["ENDC"]))
print("\nRepositories summary")
print("=" * 79)
print("{0}{1}/{2} enabled default repositories and {3} custom.".format(
self.meta.color["GREY"], def_cnt, len(self.all_repos), cus_cnt))
print("For enable or disable default repositories edit "
"'/etc/slpkg/repositories.conf'\nfile.\n{0}".format(
self.meta.color["ENDC"]))
raise SystemExit()
示例10: __init__
def __init__(self, packages):
self.packages = packages
self.meta = _meta_
self.msg = Msg()
self.commands = {
"i": "installpkg",
"u": "upgradepkg --install-new",
"r": "upgradepkg --reinstall"
}
示例11: __init__
def __init__(self, path, url, repo):
self.path = path
self.url = url
self.repo = repo
self.file_name = ""
self.meta = _meta_
self.msg = Msg()
self.dir_prefix = ""
self.downder = self.meta.downder
self.downder_options = self.meta.downder_options
示例12: __init__
def __init__(self):
self.meta = _meta_
self.msg = Msg()
self.red = self.meta.color["RED"]
self.green = self.meta.color["GREEN"]
self.endc = self.meta.color["ENDC"]
self.br = ""
if self.meta.use_colors in ["off", "OFF"]:
self.br = ")"
self.etc = "/etc/"
self.news = []
示例13: __init__
def __init__(self):
self.meta = _meta_
self.msg = Msg()
self.tag = "[REPOSITORIES]"
self.tag_line = False
self.repositories_conf = "repositories.conf"
self.conf = Utils().read_file(
self.meta.conf_path + self.repositories_conf)
self.enabled = []
self.disabled = []
self.selected = []
示例14: __init__
def __init__(self, image):
self.image = image
self.meta = _meta_
self.msg = Msg()
self.grey = self.meta.color["GREY"]
self.green = self.meta.color["GREEN"]
self.endc = self.meta.color["ENDC"]
self.dmap = {}
self.count_pkg = 0
self.count_dep = 0
self.dep_path = self.meta.log_path + "dep/"
self.logs = find_package("", self.dep_path)
if not self.logs:
self.no_logs()
self.installed = find_package("", self.meta.pkg_path)
示例15: __init__
def __init__(self, script, sources, path):
self.script = script
self.sources = sources
self.path = path
self.meta = _meta_
self.msg = Msg()
self.prgnam = self.script[:-7]
self.log_file = "build_{0}_log".format(self.prgnam)
self.sbo_logs = self.meta.log_path + "sbo/"
self.build_logs = self.sbo_logs + "build_logs/"
self.start_log_time = time.strftime("%H:%M:%S")
self.start_time = time.time()
if not os.path.exists(self.meta.log_path):
os.mkdir(self.meta.log_path)
if not os.path.exists(self.sbo_logs):
os.mkdir(self.sbo_logs)
if not os.path.exists(self.build_logs):
os.mkdir(self.build_logs)