Python __init__.__version__() Examples

The following are 7 code examples of __init__.__version__(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module __init__ , or try the search function .
Example #1
Source File: GUI.py    From Tickeys-linux with MIT License 6 votes vote down vote up
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)) 
Example #2
Source File: cli.py    From song-cli with MIT License 5 votes vote down vote up
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() 
Example #3
Source File: TriStats.py    From TriFusion with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #4
Source File: app.py    From GeoHealthCheck with MIT License 5 votes vote down vote up
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())
    } 
Example #5
Source File: main.py    From alphagozero with MIT License 5 votes vote down vote up
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() 
Example #6
Source File: flowcraft.py    From flowcraft with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #7
Source File: engine.py    From flowcraft with GNU General Public License v3.0 4 votes vote down vote up
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", {})