#!/usr/bin/env python3 # -*- coding: utf-8 -*- from jabbercard.config import Cache from jabbercard.http.instance import HttpInstance #import logging import os #from os.path import getsize, exists import re #import time import uvicorn def main(): http_instance = HttpInstance() return http_instance.app if __name__ == 'jabbercard.__main__': directory_cache = Cache.get_directory() if not os.path.exists(directory_cache): os.mkdir(directory_cache) for subdirectory in ('details', 'photo', 'qr', 'xep_0060'): subdirectory_cache = os.path.join(directory_cache, subdirectory) if not os.path.exists(subdirectory_cache): os.mkdir(subdirectory_cache) app = main() uvicorn.run(app, host='127.0.0.1', port=8000, reload=False)