Ejemplo n.º 1
0
def main():

    global logger, ghZip, ghDoc, ghCon, lappStore, ghConVersion, worker

    # logger
    logger = logging.getLogger(__name__)
    root = logging.getLogger()
    root.setLevel(logging.DEBUG)
    ch = logging.StreamHandler(sys.stdout)
    ch.setLevel(logging.DEBUG)
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    ch.setFormatter(formatter)
    root.addHandler(ch)

    # Set exit handler
    set_exit_handler(on_exit)

    # Conf path
    conf_path = os.path.abspath(os.path.join(os.path.dirname(__file__), './tmp/config.json'))
    try:
        config = json.load(open(conf_path))
    except:
        raise Exception("Config file could not be read. Please run setup.py")

    # set port
    port = config['LBSSERVICE_PORT']

    # Create zipgfactory
    ghZip = getZipFromGitHub.getZipFromGitHub("https://github.com/Lundalogik/LimeBootstrapAppStore/archive/master.zip")

    # Create documentation loader
    ghDoc = documentation.DocumentationLoader(config)

    # Create Appstore loader
    ghCon = browseGitHub.GitHubConnectorAppStore(config)

    # Create Bootstrap version checker
    ghConVersion = browseGitHub.GitHubConnectorVersion(config)

    # Create worker
    worker = UpdateChecker(ghDoc, ghCon)
    worker.start()

    # Start server
    start_server(port)
Ejemplo n.º 2
0
    api = 2

    def apply(self, fn, context):
        def _enable_cors(*args, **kwargs):
            # set CORS headers
            response.headers['Access-Control-Allow-Origin'] = '*'
            response.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, OPTIONS'
            response.headers['Access-Control-Allow-Headers'] = 'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'

            if bottle.request.method != 'OPTIONS':
                # actual request; reply with the actual response
                return fn(*args, **kwargs)

        return _enable_cors

ghZip = getZipFromGitHub.getZipFromGitHub("https://github.com/Lundalogik/LimeBootstrapAppStore/archive/master.zip")

print("Creating DocumentationLoader")
#ghDoc = documentation.DocumentationLoader();
#ghDoc.verifyIntegrity();

print("Starting LappStore!")
ghCon = browseGitHub.GitHubConnectorAppStore()
print("Loading data from GitHub AppStore...")
ghCon.getAppsJSON()

#print("Starting Core!")
#ghConCore = browseGitHub.GitHubConnectorCore()
#print("Loading data from GitHub Core...")
#ghConCore.getManualData()