本文整理匯總了Python中__init__.__version__方法的典型用法代碼示例。如果您正苦於以下問題:Python __init__.__version__方法的具體用法?Python __init__.__version__怎麽用?Python __init__.__version__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類__init__
的用法示例。
在下文中一共展示了__init__.__version__方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: check_update_and_notify
# 需要導入模塊: import __init__ [as 別名]
# 或者: from __init__ import __version__ [as 別名]
def check_update_and_notify():
try:
import urllib
import json
logger.info("Version checking...")
r = urllib.urlopen('http://billbill.sinaapp.com/tickeys')
return_msg = json.loads(r.read())
print return_msg
if return_msg["version"] <= __version__:
logger.debug("Version checking success. It is the latest version...")
else:
# show update notify
notify_content = _("Update Notify") % (return_msg["version"], return_msg["update"])
print notify_content
show_notify(notify_content)
except Exception, e:
logger.exception(e)
logger.error("Version checking fail:" + str(e))
示例2: main
# 需要導入模塊: import __init__ [as 別名]
# 或者: from __init__ import __version__ [as 別名]
def main():
"""Main CLI entrypoint."""
#print VERSION
from commands.download import Download
options = docopt(__doc__, version=VERSION)
#print "You reached here"
#print options
print "working."
p=Download(options)
p.run()
示例3: main
# 需要導入模塊: import __init__ [as 別名]
# 或者: from __init__ import __version__ [as 別名]
def main():
parser = argparse.ArgumentParser(description="Command line interface for "
"TriFusion Statistics module")
# Main execution
main_exec = parser.add_argument_group("Main execution")
main_exec.add_argument("-in", dest="infile", nargs="+",
help="Provide the input files.")
main_exec.add_argument("-o", dest="project_name",
help="Name of the output directory")
main_exec.add_argument("-cfg", dest="config_file",
help="Name of the configuration file with the "
"statistical analyses to be executed")
main_exec.add_argument("--generate-cfg", dest="generate_cfg",
action="store_const", const=True,
help="Generates a configuration template file")
main_exec.add_argument("-quiet", dest="quiet", action="store_const",
const=True, default=False, help="Removes all"
" terminal output")
main_exec.add_argument("-v", "--version", dest="version",
action="store_const", const=True,
help="Displays software version")
arg = parser.parse_args()
if len(sys.argv) == 1:
parser.print_help()
sys.exit(1)
if arg.version:
print(__version__)
sys.exit(1)
main_checks(arg)
stats_main(arg)
示例4: context_processors
# 需要導入模塊: import __init__ [as 別名]
# 或者: from __init__ import __version__ [as 別名]
def context_processors():
"""global context processors for templates"""
rtc = views.get_resource_types_counts()
tags = views.get_tag_counts()
return {
'app_version': __version__,
'resource_types': RESOURCE_TYPES,
'resource_types_counts': rtc['counts'],
'resources_total': rtc['total'],
'languages': LANGUAGES,
'tags': tags,
'tagnames': list(tags.keys())
}
示例5: main
# 需要導入模塊: import __init__ [as 別名]
# 或者: from __init__ import __version__ [as 別名]
def main():
print("Starting run (v{})".format(__version__))
init_directories()
model_name = "model_1"
model = create_initial_model(name=model_name)
while True:
model = load_latest_model()
best_model = load_best_model()
train(model, game_model_name=best_model.name)
evaluate(best_model, model)
K.clear_session()
示例6: main
# 需要導入模塊: import __init__ [as 別名]
# 或者: from __init__ import __version__ [as 別名]
def main():
args = get_args()
if args.version:
print(__version__)
if args.debug:
logger.setLevel(logging.DEBUG)
# create formatter
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
else:
logger.setLevel(logging.INFO)
# create special formatter for info logs
formatter = logging.Formatter('%(message)s')
# create console handler and set level to debug
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
# add formatter to ch
ch.setFormatter(formatter)
logger.addHandler(ch)
if args.main_op == "build":
build(args)
if args.main_op == "inspect":
inspect(args)
if args.main_op == "report":
report(args)
示例7: _set_configurations
# 需要導入模塊: import __init__ [as 別名]
# 或者: from __init__ import __version__ [as 別名]
def _set_configurations(self):
"""This method will iterate over all process in the pipeline and
populate the nextflow configuration files with the directives
of each process in the pipeline.
"""
logger.debug("======================")
logger.debug("Setting configurations")
logger.debug("======================")
resources = ""
containers = ""
params = ""
config = ""
if self.merge_params:
params += self._get_merged_params_string()
help_list = self._get_merged_params_help()
else:
params += self._get_params_string()
help_list = self._get_params_help()
for p in self.processes:
# Skip processes with the directives attribute populated
if not p.directives:
continue
logger.debug("[{}] Adding directives: {}".format(
p.template, p.directives))
resources += self._get_resources_string(p.directives, p.pid)
containers += self._get_container_string(p.directives, p.pid)
self.resources = self._render_config("resources.config", {
"process_info": resources
})
self.containers = self._render_config("containers.config", {
"container_info": containers
})
self.params = self._render_config("params.config", {
"params_info": params
})
self.config = self._render_config("nextflow.config", {
"pipeline_name": self.pipeline_name,
"nf_file": self.nf_file
})
self.help = self._render_config("Helper.groovy", {
"nf_file": basename(self.nf_file),
"help_list": help_list,
"version": __version__,
"pipeline_name": " ".join([x.upper() for x in self.pipeline_name])
})
self.user_config = self._render_config("user.config", {})