diff options
author | Cédric Picard <cedric.picard@efrei.net> | 2017-09-18 09:46:08 +0200 |
---|---|---|
committer | VG <vg@devys.org> | 2017-09-18 09:46:08 +0200 |
commit | 0bbcda16e06a34376aa0800a92f8201c90f53692 (patch) | |
tree | 70651cc09a84a58f15a44834a10e4215567b11e5 | |
parent | 0e03946ef1a894109d40943c295cd7acaef0a344 (diff) | |
download | shareit-0bbcda16e06a34376aa0800a92f8201c90f53692.tar.gz shareit-0bbcda16e06a34376aa0800a92f8201c90f53692.tar.bz2 shareit-0bbcda16e06a34376aa0800a92f8201c90f53692.zip |
Removes useless comments, create tmp dir if needed
-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') |