From af06a67d58bed00efbb43461eca7a915ed1f6df1 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Thu, 8 Oct 2015 14:30:32 +0200 Subject: [PATCH] Renamed config value From FILE_STORAGE to STORAGE_DIR to comply with the existing naming schema. --- pillar/application/modules/file_storage/__init__.py | 2 +- pillar/application/modules/file_storage/serve.py | 2 +- pillar/manage.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pillar/application/modules/file_storage/__init__.py b/pillar/application/modules/file_storage/__init__.py index a58c8863..0f55c434 100644 --- a/pillar/application/modules/file_storage/__init__.py +++ b/pillar/application/modules/file_storage/__init__.py @@ -105,7 +105,7 @@ def index(file_name=None): #POST file file_name = request.form['name'] folder_name = file_name[:2] - file_folder_path = os.path.join(app.config['FILE_STORAGE'], + file_folder_path = os.path.join(app.config['STORAGE_DIR'], folder_name) if not os.path.exists(file_folder_path): os.mkdir(file_folder_path) diff --git a/pillar/application/modules/file_storage/serve.py b/pillar/application/modules/file_storage/serve.py index 7a00e24f..60d7c8c5 100644 --- a/pillar/application/modules/file_storage/serve.py +++ b/pillar/application/modules/file_storage/serve.py @@ -68,7 +68,7 @@ def index(file_name=None): #POST file file_name = request.form['name'] folder_name = file_name[:2] - file_folder_path = os.path.join(app.config['FILE_STORAGE'], + file_folder_path = os.path.join(app.config['STORAGE_DIR'], folder_name) if not os.path.exists(file_folder_path): os.mkdir(file_folder_path) diff --git a/pillar/manage.py b/pillar/manage.py index c6ae084a..dec35e4f 100644 --- a/pillar/manage.py +++ b/pillar/manage.py @@ -15,18 +15,18 @@ def runserver(): PORT = config.Development.PORT HOST = config.Development.HOST DEBUG = config.Development.DEBUG - app.config['FILE_STORAGE'] = config.Development.FILE_STORAGE + app.config['STORAGE_DIR'] = config.Development.STORAGE_DIR except ImportError: # Default settings PORT = 5000 HOST = '0.0.0.0' DEBUG = True - app.config['FILE_STORAGE'] = '{0}/application/static/storage'.format( + app.config['STORAGE_DIR'] = '{0}/application/static/storage'.format( os.path.dirname(os.path.realpath(__file__))) - # Automatic creation of FILE_STORAGE path if it's missing - if not os.path.exists(app.config['FILE_STORAGE']): - os.makedirs(app.config['FILE_STORAGE']) + # Automatic creation of STORAGE_DIR path if it's missing + if not os.path.exists(app.config['STORAGE_DIR']): + os.makedirs(app.config['STORAGE_DIR']) app.run( port=PORT,