|
@@ -27,22 +27,17 @@ from tracim.models import get_engine, get_session_factory
|
27
|
27
|
class WebdavAppFactory(object):
|
28
|
28
|
|
29
|
29
|
def __init__(self,
|
30
|
|
- webdav_config_file_path: str = None,
|
31
|
30
|
tracim_config_file_path: str = None,
|
32
|
31
|
):
|
33
|
32
|
self.config = self._initConfig(
|
34
|
|
- webdav_config_file_path,
|
35
|
33
|
tracim_config_file_path
|
36
|
34
|
)
|
37
|
35
|
|
38
|
36
|
def _initConfig(self,
|
39
|
|
- webdav_config_file_path: str = None,
|
40
|
37
|
tracim_config_file_path: str = None
|
41
|
38
|
):
|
42
|
39
|
"""Setup configuration dictionary from default,
|
43
|
40
|
command line and configuration file."""
|
44
|
|
- if not webdav_config_file_path:
|
45
|
|
- webdav_config_file_path = DEFAULT_WEBDAV_CONFIG_FILE
|
46
|
41
|
if not tracim_config_file_path:
|
47
|
42
|
tracim_config_file_path = DEFAULT_TRACIM_CONFIG_FILE
|
48
|
43
|
|
|
@@ -50,20 +45,20 @@ class WebdavAppFactory(object):
|
50
|
45
|
config = DEFAULT_CONFIG.copy()
|
51
|
46
|
temp_verbose = config["verbose"]
|
52
|
47
|
|
53
|
|
- default_config_file = os.path.abspath(webdav_config_file_path)
|
54
|
|
- webdav_config_file = self._readConfigFile(
|
55
|
|
- webdav_config_file_path,
|
56
|
|
- temp_verbose
|
57
|
|
- )
|
58
|
|
- # Configuration file overrides defaults
|
59
|
|
- config.update(webdav_config_file)
|
60
|
|
-
|
61
|
48
|
# Get pyramid Env
|
62
|
49
|
tracim_config_file_path = os.path.abspath(tracim_config_file_path)
|
63
|
50
|
config['tracim_config'] = tracim_config_file_path
|
64
|
51
|
settings = get_appsettings(config['tracim_config'])
|
65
|
52
|
app_config = CFG(settings)
|
66
|
53
|
|
|
54
|
+ default_config_file = os.path.abspath(settings['wsgidav.config_path'])
|
|
55
|
+ webdav_config_file = self._readConfigFile(
|
|
56
|
+ default_config_file,
|
|
57
|
+ temp_verbose
|
|
58
|
+ )
|
|
59
|
+ # Configuration file overrides defaults
|
|
60
|
+ config.update(webdav_config_file)
|
|
61
|
+
|
67
|
62
|
if not useLxml and config["verbose"] >= 1:
|
68
|
63
|
print(
|
69
|
64
|
"WARNING: Could not import lxml: using xml instead (slower). "
|