本文整理匯總了Python中version.Version.current方法的典型用法代碼示例。如果您正苦於以下問題:Python Version.current方法的具體用法?Python Version.current怎麽用?Python Version.current使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類version.Version
的用法示例。
在下文中一共展示了Version.current方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: launch_analytics
# 需要導入模塊: from version import Version [as 別名]
# 或者: from version.Version import current [as 別名]
def launch_analytics(self, args):
# Now that we're all done with the boot, send a beacone home
launch_data = vars(args)
launch_data['version'] = Version.current()
launch_data['platform'] = platform.linux_distribution()
try:
launch_data['browser'] = subprocess.check_output(["xdg-settings", "get", "default-web-browser"]).strip()
except subprocess.CalledProcessError as e:
launch_data['browser'] = "unknown"
示例2: main
# 需要導入模塊: from version import Version [as 別名]
# 或者: from version.Version import current [as 別名]
def main():
parser = argparse.ArgumentParser(description='Hacker News in your System Tray')
parser.add_argument('-v','--version', action='version', version=Version.current())
parser.add_argument('-c','--comments', dest='comments',action='store_true', help="Load the HN comments link for the article as well")
parser.add_argument('--chrome', dest='chrome', help="Specify a Google Chrome Profile directory to use for matching chrome history")
parser.add_argument('--firefox', dest='firefox', help="Specify a Firefox Profile directory to use for matching firefox history")
parser.add_argument('--dnt', dest='dnt',action='store_true', help="Disable all analytics (Do Not Track)")
parser.set_defaults(comments=False)
parser.set_defaults(dnt=False)
args = parser.parse_args()
indicator = HackerNewsApp(args)
indicator.run()