Browse Source

Homogenises directories names in configuration.

Adrien Panay 7 years ago
parent
commit
4fc49fe707

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

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

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

131
 def configure_depot():
131
 def configure_depot():
132
     """Configure Depot."""
132
     """Configure Depot."""
133
     depot_storage_name = 'default'
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
     depot_storage_settings = {'depot.storage_path': depot_storage_path}
135
     depot_storage_settings = {'depot.storage_path': depot_storage_path}
136
     DepotManager.configure(depot_storage_name,
136
     DepotManager.configure(depot_storage_name,
137
                            depot_storage_settings)
137
                            depot_storage_settings)
222
 
222
 
223
     def __init__(self):
223
     def __init__(self):
224
         """Parse configuration file."""
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
         self.DATA_UPDATE_ALLOWED_DURATION = \
228
         self.DATA_UPDATE_ALLOWED_DURATION = \
229
             int(tg.config.get('content.update.allowed.duration', 0))
229
             int(tg.config.get('content.update.allowed.duration', 0))

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

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

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

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