コード例 #1
0
    def read_version():
        """
        Return the application's version number as a string

        :return:
        """
        return metadata.read_version_string('long')
コード例 #2
0
ファイル: service.py プロジェクト: luis4ndre/unmanic
def main():
    parser = argparse.ArgumentParser(description='Unmanic')
    parser.add_argument('--version',
                        action='version',
                        version='%(prog)s {version}'.format(
                            version=metadata.read_version_string('long')))

    parser.add_argument('--manage_plugins',
                        action='store_true',
                        help='manage installed plugins')
    args = parser.parse_args()

    if args.manage_plugins:
        # Init the DB connection
        db_connection = init_db()
        db_connection.start()

        # Run the plugin manager CLI
        plugin_cli = PluginsCLI()
        plugin_cli.run()

        # Stop the DB connection
        db_connection.stop()
    else:
        # Run the main Unmanic service
        service = Service()
        service.run()
コード例 #3
0
    def read_version(self):
        """
        Return the application's version number as a string

        :return:
        """
        if not self.app_version:
            self.app_version = metadata.read_version_string('long')
        return self.app_version
コード例 #4
0
def main():
    parser = argparse.ArgumentParser(description='Unmanic')
    parser.add_argument('--version',
                        action='version',
                        version='%(prog)s {version}'.format(
                            version=metadata.read_version_string('long')))
    parser.add_argument('--manage_plugins',
                        action='store_true',
                        help='manage installed plugins')
    parser.add_argument('--dev',
                        action='store_true',
                        help='Enable developer mode')
    parser.add_argument('--port',
                        nargs='?',
                        help='Specify the port to run the webserver on')
    # parser.add_argument('--unmanic_path', nargs='?',
    #                    help='Specify the unmanic configuration path instead of ~/.unmanic')
    args = parser.parse_args()

    # Configure application from args
    settings = config.Config(port=args.port, unmanic_path=None)

    if args.manage_plugins:
        # Init the DB connection
        db_connection = init_db(settings.get_config_path())

        # Run the plugin manager CLI
        from unmanic.libs.unplugins.pluginscli import PluginsCLI
        plugin_cli = PluginsCLI()
        plugin_cli.run()

        # Stop the DB connection
        db_connection.stop()
        while not db_connection.is_stopped():
            time.sleep(0.1)
            continue
    else:
        # Run the main Unmanic service
        service = Service()
        service.developer = args.dev
        service.run()