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

Python arguments.usage函数代码示例

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

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



在下文中一共展示了usage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

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


示例2: pkg_install

 def pkg_install(self):
     """Install packages by repository
     """
     flag = []
     options = [
         "-s",
         "--sync"
     ]
     additional_options = [
         "--resolve-off",
         "--case-ins"
     ]
     for arg in self.args:
         if arg in additional_options:
             flag.append(arg)
     if len(self.args) >= 3 and self.args[0] in options:
         if (self.args[1] in self.meta.repositories and
                 self.args[1] not in ["sbo"]):
             BinaryInstall(self.args[2:], self.args[1], flag).start(
                 if_upgrade=False)
         elif (self.args[1] == "sbo" and
                 self.args[1] in self.meta.repositories):
             SBoInstall(self.args[2:], flag).start(if_upgrade=False)
         else:
             usage(self.args[1])
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:27,代码来源:main.py


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


示例4: command_repo_enable

 def command_repo_enable(self):
     """Repositories enable/disable
     """
     if len(self.args) == 1 and self.args[0] == "repo-enable":
         RepoEnable().choose()
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:7,代码来源:main.py


示例5: command_repo_list

 def command_repo_list(self):
     """Repositories list
     """
     if len(self.args) == 1 and self.args[0] == "repo-list":
         RepoList().repos()
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:7,代码来源:main.py


示例6: pkg_tracking

 def pkg_tracking(self):
     """Tracking package dependencies
     """
     flag = []
     options = [
         "-t",
         "--tracking"
     ]
     additional_options = [
         "--check-deps",
         "--graph="
     ]
     if (len(self.args) >= 3 and len(self.args) < 6 and
             self.args[0] in options):
         if self.args[1] in self.meta.repositories:
             for arg in self.args[3:]:
                 if arg.startswith(additional_options[1]):
                     flag.append(arg)
                 if arg in additional_options:
                     flag.append(arg)
             TrackingDeps(self.args[2], self.args[1], flag).run()
         else:
             usage(self.args[1])
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:25,代码来源:main.py


示例7: command_update_slpkg

 def command_update_slpkg(self):
     """Slpkg it self update
     """
     if len(self.args) == 2 and self.args[0] == "update-slpkg":
         it_self_update()
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:7,代码来源:main.py


示例8: 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.args[0] in options and
             self.args[1] == command[0]):
         blacklist.listed()
     elif (len(self.args) > 2 and self.args[0] in options and
             self.args[-1] == flag[0]):
         blacklist.add(self.args[1:-1])
     elif (len(self.args) == 3 and self.args[0] in options and
             self.args[1] == "ALL" and self.args[-1] == flag[1]):
         blacklist.remove(blacklist.get_black())
     elif (len(self.args) > 2 and self.args[0] in options and
             self.args[-1] == flag[1]):
         blacklist.remove(self.args[1:-1])
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:27,代码来源:main.py


示例9: bin_install

 def bin_install(self):
     """Install Slackware binary packages
     """
     packages = self.args[1:]
     options = [
         "-i",
         "--installpkg"
     ]
     flag = ""
     flags = [
         "--warn",
         "--md5sum",
         "--root",
         "--infobox",
         "--menu",
         "--terse",
         "--ask",
         "--priority",
         "--tagfile"
     ]
     if len(self.args) > 1 and self.args[0] in options:
         if self.args[1] in flags:
             flag = self.args[1]
             packages = self.args[2:]
         PackageManager(packages).install(flag)
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:27,代码来源:main.py


示例10: bin_remove

 def bin_remove(self):
     """Remove Slackware packages
     """
     packages = self.args[1:]
     options = [
         "-r",
         "--removepkg"
     ]
     additional_options = [
         "--deps",
         "--check-deps",
         "--tag",
         "--checklist"
     ]
     flag, extra = "", []
     flags = [
         "-warn",
         "-preserve",
         "-copy",
         "-keep"
     ]
     if len(self.args) > 1 and self.args[0] in options:
         for additional in additional_options:
             if additional in self.args:
                 extra.append(additional)
                 self.args.remove(additional)
             packages = self.args[1:]
         if self.args[1] in flags:
             flag = self.args[1]
             packages = self.args[2:]
         PackageManager(packages).remove(flag, extra)
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:33,代码来源:main.py


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


示例12: 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.args[1]).test()
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:10,代码来源:main.py


示例13: 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=")):
         repos = self.args[1].split("=")[-1].split(",")
         Initialization(False).upgrade(repos)
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:11,代码来源:main.py


示例14: 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:] == []):
         prog_version()
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:11,代码来源:main.py


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


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


示例17: command_repo_info

 def command_repo_info(self):
     """Repositories informations
     """
     if (len(self.args) == 2 and self.args[0] == "repo-info" and
             self.args[1] in RepoList().all_repos):
         del RepoList().all_repos
         RepoInfo().view(self.args[1])
     elif (len(self.args) > 1 and self.args[0] == "repo-info" and
             self.args[1] not in RepoList().all_repos):
         usage(self.args[1])
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:12,代码来源:main.py


示例18: 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=")):
         repos = self.args[1].split("=")[-1].split(",")
         for rp in repos:
             if rp not in self.meta.repositories:
                 repos.remove(rp)
         Update().repository(repos)
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:14,代码来源:main.py


示例19: command_deps_status

 def command_deps_status(self):
     """Print dependencies status
     """
     if len(self.args) == 1 and self.args[0] == "deps-status":
         DependenciesStatus(image="").show()
     elif (len(self.args) == 2 and self.args[0] == "deps-status" and
             self.args[1].startswith("--graph=")):
         image = self.args[1].split("=")[1]
         DependenciesStatus(image).show()
     elif (len(self.args) == 2 and self.args[0] == "deps-status" and
             self.args[1] == "--tree"):
         DependenciesStatus(image="").tree()
     else:
         usage("")
开发者ID:websafe,项目名称:slpkg,代码行数:14,代码来源:main.py


示例20: ALL

 def ALL(self):
     """Check ALL enabled repositories ChangeLogs
     """
     self.status_bar()
     for repo in self.meta.repositories:
         if repo in self.meta.default_repositories:
             try:
                 self.check = self.all_repos[repo]()
             except OSError:
                 usage(self.repo)
                 raise SystemExit()
         elif repo in self.meta.repositories:
             self.check = self._init.custom(repo)
         self.status()
         self.print_status(repo)
     self.summary()
开发者ID:fabioalvaro,项目名称:slpkg,代码行数:16,代码来源:checks.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python messages.Msg类代码示例发布时间:2022-05-27
下一篇:
Python xmlstream.StanzaBase类代码示例发布时间: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