diff options
-rwxr-xr-x | shareit/shareit.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/shareit/shareit.py b/shareit/shareit.py index 4d0dbb6..c9aec98 100755 --- a/shareit/shareit.py +++ b/shareit/shareit.py @@ -6,21 +6,12 @@ import json import io import os import jinja2 -import tempfile from pathlib import Path -#from bottle import Jinja2Template as Template -#from bottle import SimpleTemplate as Template - DEV_FILES_DIR = '/tmp/files' PROD_FILES_DIR = '/files' FILES_DIR = PROD_FILES_DIR -# load templates -#templates = {} -#for template in ['propose_upload', 'upload']: -# with open(Path('templates', template + '.html').as_posix(), 'r') as fi: -# templates[template] = Template(fi.read(), lookup='./templates/') templates = jinja2.Environment( loader=jinja2.FileSystemLoader('templates')) @@ -92,7 +83,10 @@ def robot(): if __name__ == '__main__': print('I: Starting shareit application as development server') FILES_DIR = DEV_FILES_DIR - #bottle.run(host='0.0.0.0', port=8080) + try: + os.mkdir(FILES_DIR) + except FileExistsError: + pass bottle.run(host='0.0.0.0', port=8080, debug=True) else: print('I: Starting shareit application as module or wsgi application') |