Esempio n. 1
0
import config
import importlib
import os
from application.routes import migrate
from log.logger import setup_logging
import sys

exit(1)

if len(sys.argv) < 3:
    print('Insuffcient parameters specified')
    exit()

s = sys.argv[1]
e = sys.argv[2]

cfg = 'Config'
c = getattr(importlib.import_module('config'), cfg)
config = {}

for key in dir(c):
    if key.isupper():
        config[key] = getattr(c, key)

setup_logging(config)
migrate(config, s, e)
Esempio n. 2
0
from flask import Flask
import os
from log.logger import setup_logging
import logging

app = Flask(__name__)
app.config.from_object('config.Config')

setup_logging(app.config)

logging.info('================================')
logging.info(
    os.getenv('AUTOMATIC_PROCESS_URL', 'AUTOMATIC_PROCESS_URL NOT SET'))
logging.info('================================')
Esempio n. 3
0
from flask import Flask, Response
import os
from log.logger import setup_logging
import logging
import json
import requests


app = Flask(__name__)
app.config.from_object('config.Config')

setup_logging(app.config['DEBUG'])


def check_legacy_health():
    return requests.get(app.config['LEGACY_DB_URI'] + '/health')


application_dependencies = [
    {
        "name": "legacy-adapter",
        "check": check_legacy_health
    }
]


@app.route('/', methods=["GET"])
def root():
    logging.info("GET /")
    return Response(status=200)
Esempio n. 4
0
from flask import Flask
import os

app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))

from log.logger import setup_logging
setup_logging(app.config['DEBUG'])

from application import routes
from flask import Flask
import os
from log.logger import setup_logging

app = Flask(__name__)
app.config.from_object(os.environ.get('SETTINGS'))

setup_logging(app.config)
Esempio n. 6
0
import importlib
import os
from application.routes import migrate
from multiprocessing import Process

exit(1)

cfg = 'Config'
c = getattr(importlib.import_module('config'), cfg)
config = {}

for key in dir(c):
    if key.isupper():
        config[key] = getattr(c, key)

setup_logging(config)


if len(sys.argv) < 3:
    print('Insuffcient parameters specified')
    exit()
    
s = sys.argv[1]
e = sys.argv[2]


sd = datetime.fromtimestamp(time.mktime(time.strptime(s, '%Y-%m-%d')))
ed = datetime.fromtimestamp(time.mktime(time.strptime(e, '%Y-%m-%d')))
days = (ed - sd).days

# Slightly buggy: this will slice to a minimum of 1 day, so if there are too many slices it'll increase the width
Esempio n. 7
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-

import itertools
import optparse
import os
import sys
import threading
import time
import zipfile
import logging
from log.logger import setup_logging

setup_logging(filename='words.txt', title='seekplum')
info_logger = logging.getLogger("seekplum")


def zip_file(start, end):
    """

    :param start:
    :param end:
    :return:
    """
    start_time = time.time()
    curr_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    zfile = zipfile.ZipFile(os.path.join(curr_path, "zip.zip"))
    for i in range(start, end):
        try:
            zfile.extractall(pwd=str(i))
            all_time = time.time() - start_time