|
@@ -12,6 +12,8 @@ convert them into boolean, for example, you should use the
|
12
|
12
|
setting = asbool(global_conf.get('the_setting'))
|
13
|
13
|
|
14
|
14
|
"""
|
|
15
|
+import imp
|
|
16
|
+import importlib
|
15
|
17
|
from urllib.parse import urlparse
|
16
|
18
|
|
17
|
19
|
import tg
|
|
@@ -297,7 +299,34 @@ class CFG(object):
|
297
|
299
|
'604800',
|
298
|
300
|
))
|
299
|
301
|
|
300
|
|
- self.WSGIDAV_CONFIG_PATH = tg.config.get('wsgidav.config_path')
|
|
302
|
+ self.WSGIDAV_CONFIG_PATH = tg.config.get(
|
|
303
|
+ 'wsgidav.config_path',
|
|
304
|
+ 'wsgidav.conf',
|
|
305
|
+ )
|
|
306
|
+ # TODO: Convert to importlib (cf http://stackoverflow.com/questions/41063938/use-importlib-instead-imp-for-non-py-file)
|
|
307
|
+ self.wsgidav_config = imp.load_source(
|
|
308
|
+ 'wsgidav_config',
|
|
309
|
+ self.WSGIDAV_CONFIG_PATH,
|
|
310
|
+ )
|
|
311
|
+ self.WSGIDAV_PORT = self.wsgidav_config.port
|
|
312
|
+ self.WSGIDAV_CLIENT_BASE_URL = \
|
|
313
|
+ tg.config.get('wsgidav.client.base_url', None)
|
|
314
|
+
|
|
315
|
+ if not self.WSGIDAV_CLIENT_BASE_URL:
|
|
316
|
+ self.WSGIDAV_CLIENT_BASE_URL = \
|
|
317
|
+ '{0}:{1}'.format(
|
|
318
|
+ self.WEBSITE_SERVER_NAME,
|
|
319
|
+ self.WSGIDAV_PORT,
|
|
320
|
+ )
|
|
321
|
+ logger.warning(
|
|
322
|
+ self,
|
|
323
|
+ 'NOTE: Generated wsgidav.client.base_url parameter with '
|
|
324
|
+ 'followings parameters: website.server_name and '
|
|
325
|
+ 'wsgidav.conf port'.format(
|
|
326
|
+ self.WSGIDAV_CLIENT_BASE_URL,
|
|
327
|
+ )
|
|
328
|
+ )
|
|
329
|
+
|
301
|
330
|
|
302
|
331
|
def get_tracker_js_content(self, js_tracker_file_path = None):
|
303
|
332
|
js_tracker_file_path = tg.config.get('js_tracker_path', None)
|