Browse Source

Homogenises directories names in configuration.

Adrien Panay 6 years ago
parent
commit
4fc49fe707

+ 6 - 4
tracim/development.ini.base View File

@@ -34,8 +34,13 @@ use = egg:tracim
34 34
 full_stack = true
35 35
 # You can set french as default language by uncommenting next line
36 36
 # lang = fr
37
+
37 38
 cache_dir = %(here)s/data/cache
39
+# preview generator cache directory
38 40
 preview_cache_dir = %(here)s/data/cache/preview/
41
+# file depot storage directory
42
+depot_storage_dir = %(here)s/data/depot/
43
+
39 44
 beaker.session.key = tracim
40 45
 beaker.session.secret = 3283411b-1904-4554-b0e1-883863b53080
41 46
 
@@ -176,7 +181,7 @@ website.treeview.content = all
176 181
 website.base_url = http://127.0.0.1:8080
177 182
 # If config not provided, it will be extracted from website.base_url
178 183
 website.server_name = 127.0.0.1
179
-    
184
+
180 185
 email.notification.activated = False
181 186
 email.notification.from.email = noreply@trac.im
182 187
 email.notification.from.default_label = Tracim Notifications
@@ -222,9 +227,6 @@ wsgidav.config_path = wsgidav.conf
222 227
 ## Do not set http:// prefix.
223 228
 # wsgidav.client.base_url = 127.0.0.1:<WSGIDAV_PORT>
224 229
 
225
-## DEPOT
226
-depot_storage_path = %(here)s/data/depot/
227
-
228 230
 #####
229 231
 #
230 232
 # All configuration below is about logging.

+ 3 - 3
tracim/tracim/config/app_cfg.py View File

@@ -131,7 +131,7 @@ def start_daemons(manager: DaemonsManager):
131 131
 def configure_depot():
132 132
     """Configure Depot."""
133 133
     depot_storage_name = 'default'
134
-    depot_storage_path = CFG.get_instance().DEPOT_STORAGE_PATH
134
+    depot_storage_path = CFG.get_instance().DEPOT_STORAGE_DIR
135 135
     depot_storage_settings = {'depot.storage_path': depot_storage_path}
136 136
     DepotManager.configure(depot_storage_name,
137 137
                            depot_storage_settings)
@@ -222,8 +222,8 @@ class CFG(object):
222 222
 
223 223
     def __init__(self):
224 224
         """Parse configuration file."""
225
-        self.DEPOT_STORAGE_PATH = tg.config.get('depot_storage_path')
226
-        self.PREVIEW_CACHE = tg.config.get('preview_cache_dir')
225
+        self.DEPOT_STORAGE_DIR = tg.config.get('depot_storage_dir')
226
+        self.PREVIEW_CACHE_DIR = tg.config.get('preview_cache_dir')
227 227
 
228 228
         self.DATA_UPDATE_ALLOWED_DURATION = \
229 229
             int(tg.config.get('content.update.allowed.duration', 0))

+ 1 - 1
tracim/tracim/controllers/content.py View File

@@ -194,7 +194,7 @@ class UserWorkspaceFolderFileRestController(TIMWorkspaceContentRestController):
194 194
     @tg.expose('tracim.templates.file.getone')
195 195
     def get_one(self, file_id, revision_id=None):
196 196
         file_id = int(file_id)
197
-        cache_path = CFG.get_instance().PREVIEW_CACHE
197
+        cache_path = CFG.get_instance().PREVIEW_CACHE_DIR
198 198
         preview_manager = PreviewManager(cache_path, create_folder=True)
199 199
         user = tmpl_context.current_user
200 200
         workspace = tmpl_context.workspace

+ 2 - 2
tracim/tracim/controllers/page.py View File

@@ -32,7 +32,7 @@ class PagesController(TIMRestController):
32 32
         file_id = int(tg.request.controller_state.routing_args.get('file_id'))
33 33
         page = int(page_id)
34 34
         revision_id = int(revision_id) if revision_id != 'latest' else None
35
-        cache_path = CFG.get_instance().PREVIEW_CACHE
35
+        cache_path = CFG.get_instance().PREVIEW_CACHE_DIR
36 36
         preview_manager = PreviewManager(cache_path, create_folder=True)
37 37
         user = tmpl_context.current_user
38 38
         content_api = ContentApi(user,
@@ -81,7 +81,7 @@ class PagesController(TIMRestController):
81 81
         file_id = int(tg.request.controller_state.routing_args.get('file_id'))
82 82
         revision_id = int(revision_id) if revision_id != 'latest' else None
83 83
         page = int(page_id)
84
-        cache_path = CFG.get_instance().PREVIEW_CACHE
84
+        cache_path = CFG.get_instance().PREVIEW_CACHE_DIR
85 85
         preview_manager = PreviewManager(cache_path, create_folder=True)
86 86
         user = tmpl_context.current_user
87 87
         content_api = ContentApi(user,