当前位置: 首页>>代码示例>>Python>>正文


Python __init__.__version__方法代码示例

本文整理汇总了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)) 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:20,代码来源:GUI.py

示例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() 
开发者ID:ankitmathur3193,项目名称:song-cli,代码行数:12,代码来源:cli.py

示例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) 
开发者ID:ODiogoSilva,项目名称:TriFusion,代码行数:39,代码来源:TriStats.py

示例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())
    } 
开发者ID:geopython,项目名称:GeoHealthCheck,代码行数:16,代码来源:app.py

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

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

示例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", {}) 
开发者ID:assemblerflow,项目名称:flowcraft,代码行数:55,代码来源:engine.py


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