JabberCard/jabbercard/__main__.py
Schimon Jehudah, Adv. 5e495579c2 Add file PyProject;
Support display of a single pubsub node item;
Update document README;
Modularize code;
2024-11-17 17:30:38 +02:00

25 lines
764 B
Python

#!/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)