sleep(self.delay_between_updates) class WebThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): from modules import web_server web_server.run() if __name__ == "__main__": args = arguments.parse_args() config = ConfigReader('conf/updater.conf') logging.basicConfig(filename=config.log_file(), level=logging.getLevelName(config.log_level().upper()), format='%(asctime)s - %(levelname)s - %(message)s') updater_kwargs = {} if len(sys.argv) > 1: # called script with args, so check the args, and override the configs settings if args.ini: config.set_path_to_one_file(args.ini) updater_kwargs['demonize'] = False if args.configs_directory: config.set_path_to_projects_configs(args.configs_directory) updater_kwargs['full_verbose'] = args.verbose_full
from flask import Flask, abort, request import logging from modules.config_reader import ConfigReader from modules.updater import Updater import json app = Flask('WebGitUpdaterService', ) config_instance = ConfigReader('conf/updater.conf') # global instance for Updater class updater = None # log logging.basicConfig(filename=config_instance.log_file(), level=logging.getLevelName( config_instance.log_level().upper()), format='%(asctime)s - %(levelname)s - %(message)s') def github_get_repo_name(data): return data['repository']['name'] def gitlab_get_repo_name(data): pass def gogs_get_repo_name(data): pass