• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python messages.Msg类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中slpkg.messages.Msg的典型用法代码示例。如果您正苦于以下问题:Python Msg类的具体用法?Python Msg怎么用?Python Msg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Msg类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()
开发者ID:websafe,项目名称:slpkg,代码行数:25,代码来源:main.py


示例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")
开发者ID:BrentonEarl,项目名称:slpkg,代码行数:27,代码来源:slackbuild.py


示例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
开发者ID:BrentonEarl,项目名称:slpkg,代码行数:7,代码来源:health.py


示例4: __init__

 def __init__(self, binary):
     self.binary = binary
     self.meta = _meta_
     self.msg = Msg()
     self.skip = []
     self.size = 0
     self.unit = "Kb"
开发者ID:websafe,项目名称:slpkg,代码行数:7,代码来源:manager.py


示例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
     }
开发者ID:fabioalvaro,项目名称:slpkg,代码行数:26,代码来源:checks.py


示例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
开发者ID:dslackw,项目名称:slpkg,代码行数:29,代码来源:install.py


示例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()
开发者ID:fabioalvaro,项目名称:slpkg,代码行数:35,代码来源:network.py


示例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("")
开发者ID:dslackw,项目名称:slpkg,代码行数:47,代码来源:desc.py


示例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()
开发者ID:fabioalvaro,项目名称:slpkg,代码行数:47,代码来源:repolist.py


示例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"
     }
开发者ID:fabioalvaro,项目名称:slpkg,代码行数:9,代码来源:auto_pkg.py


示例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
开发者ID:fabioalvaro,项目名称:slpkg,代码行数:10,代码来源:downloader.py


示例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 = []
开发者ID:fabioalvaro,项目名称:slpkg,代码行数:11,代码来源:new_config.py


示例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 = []
开发者ID:websafe,项目名称:slpkg,代码行数:11,代码来源:repoenable.py


示例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)
开发者ID:fabioalvaro,项目名称:slpkg,代码行数:15,代码来源:status_deps.py


示例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)
开发者ID:websafe,项目名称:slpkg,代码行数:18,代码来源:build.py


示例16: __init__

 def __init__(self, name, repo, flag):
     self.name = name
     self.repo = repo
     self.flag = flag
     self.meta = _meta_
     self.msg = Msg()
     self.green = self.meta.color["GREEN"]
     self.yellow = self.meta.color["YELLOW"]
     self.cyan = self.meta.color["CYAN"]
     self.red = self.meta.color["RED"]
     self.endc = self.meta.color["ENDC"]
     self.requires = []
     self.dependencies = []
     self.dependencies_list = []
     self.deps_dict = {}
     for i in range(0, len(self.flag)):
         if self.flag[i].startswith("--graph="):
             self.image = self.flag[i].split("=")[1]
             self.flag[i] = "--graph="
开发者ID:BrentonEarl,项目名称:slpkg,代码行数:19,代码来源:tracking.py


示例17: __init__

 def __init__(self, packages, repo, flag):
     self.packages = 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
     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.blacklist = BlackList().packages(self.data[0], self.repo)
开发者ID:websafe,项目名称:slpkg,代码行数:19,代码来源:install.py


示例18: Auto

class Auto(object):
    """Select Slackware command to install packages
    """
    def __init__(self, packages):
        self.packages = packages
        self.meta = _meta_
        self.msg = Msg()
        self.commands = {
            "i": "installpkg",
            "u": "upgradepkg --install-new",
            "r": "upgradepkg --reinstall"
        }

    def select(self):
        """Select Slackware command
        """
        print("\nDetected Slackware binary package for installation:\n")
        for pkg in self.packages:
            print(" " + pkg.split("/")[-1])
        print("")
        self.msg.template(78)
        print("| Choose a Slackware command:")
        self.msg.template(78)
        for com in sorted(self.commands):
            print("| {0}{1}{2}) {3}{4}{5}".format(
                self.meta.color["RED"], com, self.meta.color["ENDC"],
                self.meta.color["GREEN"], self.commands[com],
                self.meta.color["ENDC"]))
        self.msg.template(78)
        try:
            self.choice = raw_input(" > ")
        except EOFError:
            print("")
            raise SystemExit()
        if self.choice in self.commands.keys():
            sys.stdout.write("   \x1b[1A{0}{1}{2}\n\n".format(
                self.meta.color["CYAN"], self.commands[self.choice],
                self.meta.color["ENDC"]))
            sys.stdout.flush()
        self.execute()

    def execute(self):
        """Execute Slackware command
        """
        if self.choice in self.commands.keys():
            if self.choice == "i":
                PackageManager(self.packages).install("")
            elif self.choice in ["u", "r"]:
                PackageManager(self.packages).upgrade(
                    self.commands[self.choice][11:])
开发者ID:fabioalvaro,项目名称:slpkg,代码行数:50,代码来源:auto_pkg.py


示例19: __init__

 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)
开发者ID:dslackw,项目名称:slpkg,代码行数:20,代码来源:desc.py


示例20: __init__

 def __init__(self):
     self.meta = _meta_
     self.msg = Msg()
     self.all_repos = {
         "slack": Repo().slack(),
         "sbo": Repo().sbo(),
         "rlw": Repo().rlw(),
         "alien": Repo().alien(),
         "slacky": Repo().slacky(),
         "studio": Repo().studioware(),
         "slackr": Repo().slackers(),
         "slonly": Repo().slackonly(),
         "ktown": Repo().ktown(),
         "multi": Repo().multi(),
         "slacke": Repo().slacke(),
         "salix": Repo().salix(),
         "slackl": Repo().slackel(),
         "rested": Repo().restricted(),
         "msb": Repo().msb(),
     }
     self.all_repos.update(Repo().custom_repository())
开发者ID:websafe,项目名称:slpkg,代码行数:21,代码来源:repolist.py



注:本文中的slpkg.messages.Msg类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python find.find_package函数代码示例发布时间:2022-05-27
下一篇:
Python arguments.usage函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap