예제 #1
0
def get_biothings_commit():
    ''' Gets the biothings commit information. '''
    global BIOTHINGS_REPO_DATA
    if BIOTHINGS_REPO_DATA:
        return BIOTHINGS_REPO_DATA

    try:
        with open(
                os.path.join(os.path.dirname(biothings.__file__), '.git-info'),
                'r') as f:
            lines = [l.strip('\n') for l in f.readlines()]
        BIOTHINGS_REPO_DATA = {
            'repository-url': lines[0],
            'commit-hash': lines[1],
            'master-commits': lines[2],
            'version': biothings.get_version()
        }
    except:
        BIOTHINGS_REPO_DATA = {
            'repository-url': '',
            'commit-hash': '',
            'master-commits': '',
            'version': biothings.get_version()
        }

    return BIOTHINGS_REPO_DATA
예제 #2
0
 def __init__(self, config_module=None):
     # About debug mode in tornado:
     # https://www.tornadoweb.org/en/stable/guide/running.html \
     # #debug-mode-and-automatic-reloading
     logging.info("Biothings API %s", get_version())
     self.config = BiothingESWebSettings(config_module)
     self.handlers = []  # additional handlers
     self.settings = dict(debug=False)
     self.host = None