Passed
Push — master ( ed1cae...acd77f )
by
unknown
02:26
created

tracim.config.RequestWithCFG.app_config()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
from urllib.parse import urlparse
3
from paste.deploy.converters import asbool
4
from tracim.lib.utils.logger import logger
5
from depot.manager import DepotManager
6
7
from pyramid.request import Request
8
9
10
class RequestWithCFG(Request):
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many ancestors (10/7)
Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
11
12
    def app_config(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
13
        cfg = CFG(self.registry.settings)
0 ignored issues
show
Bug introduced by
The Instance of RequestWithCFG does not seem to have a member named registry.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
14
        cfg.configure_filedepot()
15
        return cfg
16
17
18
class CFG(object):
0 ignored issues
show
best-practice introduced by
Too many instance attributes (13/7)
Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
19
    """Object used for easy access to config file parameters."""
20
21
    def __setattr__(self, key, value):
22
        """
23
        Log-ready setter.
24
25
        Logs all configuration parameters except password.
26
        :param key:
27
        :param value:
28
        :return:
29
        """
30
        if 'PASSWORD' not in key and \
31
                ('URL' not in key or type(value) == str) and \
0 ignored issues
show
introduced by
Using type() instead of isinstance() for a typecheck.
Loading history...
32
                'CONTENT' not in key:
33
            # We do not show PASSWORD for security reason
34
            # we do not show URL because At the time of configuration setup,
35
            # it can't be evaluated
36
            # We do not show CONTENT in order not to pollute log files
37
            logger.info(self, 'CONFIG: [ {} | {} ]'.format(key, value))
38
        else:
39
            logger.info(self, 'CONFIG: [ {} | <value not shown> ]'.format(key))
40
41
        self.__dict__[key] = value
42
43
    def __init__(self, settings):
44
        """Parse configuration file."""
45
46
        ###
47
        # General
48
        ###
49
50
        mandatory_msg = \
51
            'ERROR: {} configuration is mandatory. Set it before continuing.'
52
        self.DEPOT_STORAGE_DIR = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name DEPOT_STORAGE_DIR does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
53
            'depot_storage_dir',
54
        )
55
        if not self.DEPOT_STORAGE_DIR:
56
            raise Exception(
57
                mandatory_msg.format('depot_storage_dir')
58
            )
59
        self.DEPOT_STORAGE_NAME = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name DEPOT_STORAGE_NAME does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
60
            'depot_storage_name',
61
        )
62
        if not self.DEPOT_STORAGE_NAME:
63
            raise Exception(
64
                mandatory_msg.format('depot_storage_name')
65
            )
66
        self.PREVIEW_CACHE_DIR = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name PREVIEW_CACHE_DIR does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
67
            'preview_cache_dir',
68
        )
69
        if not self.PREVIEW_CACHE_DIR:
70
            raise Exception(
71
                'ERROR: preview_cache_dir configuration is mandatory. '
72
                'Set it before continuing.'
73
            )
74
75
        self.DATA_UPDATE_ALLOWED_DURATION = int(settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name DATA_UPDATE_ALLOWED_DURATION does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
76
            'content.update.allowed.duration',
77
            0,
78
        ))
79
80
        self.WEBSITE_TITLE = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name WEBSITE_TITLE does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
81
            'website.title',
82
            'TRACIM',
83
        )
84
85
        self.WEBSITE_BASE_URL = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name WEBSITE_BASE_URL does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
86
            'website.base_url',
87
            '',
88
        )
89
90
        # TODO - G.M - 26-03-2018 - [Cleanup] These params seems deprecated for tracimv2,  # nopep8
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
91
        # Verify this
92
        #
93
        # self.WEBSITE_HOME_TITLE_COLOR = settings.get(
94
        #     'website.title.color',
95
        #     '#555',
96
        # )
97
        # self.WEBSITE_HOME_IMAGE_PATH = settings.get(
98
        #     '/assets/img/home_illustration.jpg',
99
        # )
100
        # self.WEBSITE_HOME_BACKGROUND_IMAGE_PATH = settings.get(
101
        #     '/assets/img/bg.jpg',
102
        # )
103
        #
104
105
        self.WEBSITE_SERVER_NAME = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name WEBSITE_SERVER_NAME does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
106
            'website.server_name',
107
            None,
108
        )
109
110
        if not self.WEBSITE_SERVER_NAME:
111
            self.WEBSITE_SERVER_NAME = urlparse(self.WEBSITE_BASE_URL).hostname
112
            logger.warning(
113
                self,
114
                'NOTE: Generated website.server_name parameter from '
115
                'website.base_url parameter -> {0}'
116
                .format(self.WEBSITE_SERVER_NAME)
117
            )
118
119
        self.WEBSITE_HOME_TAG_LINE = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name WEBSITE_HOME_TAG_LINE does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
120
            'website.home.tag_line',
121
            '',
122
        )
123
        self.WEBSITE_SUBTITLE = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name WEBSITE_SUBTITLE does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
124
            'website.home.subtitle',
125
            '',
126
        )
127
        self.WEBSITE_HOME_BELOW_LOGIN_FORM = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name WEBSITE_HOME_BELOW_LOGIN_FORM does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
128
            'website.home.below_login_form',
129
            '',
130
        )
131
132
        self.WEBSITE_TREEVIEW_CONTENT = settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name WEBSITE_TREEVIEW_CONTENT does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
133
            'website.treeview.content',
134
        )
135
136
        self.USER_AUTH_TOKEN_VALIDITY = int(settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name USER_AUTH_TOKEN_VALIDITY does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
137
            'user.auth_token.validity',
138
            '604800',
139
        ))
140
141
        # TODO - G.M - 27-03-2018 - [Email] Restore email config
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
142
        ###
143
        # EMAIL related stuff (notification, reply)
144
        ###
145
        #
146
        # self.EMAIL_NOTIFICATION_NOTIFIED_EVENTS = [
147
        #     # ActionDescription.COMMENT,
148
        #     # ActionDescription.CREATION,
149
        #     # ActionDescription.EDITION,
150
        #     # ActionDescription.REVISION,
151
        #     # ActionDescription.STATUS_UPDATE
152
        # ]
153
        #
154
        # self.EMAIL_NOTIFICATION_NOTIFIED_CONTENTS = [
155
        #     # ContentType.Page,
156
        #     # ContentType.Thread,
157
        #     # ContentType.File,
158
        #     # ContentType.Comment,
159
        #     # ContentType.Folder -- Folder is skipped
160
        # ]
161
        # if settings.get('email.notification.from'):
162
        #     raise Exception(
163
        #         'email.notification.from configuration is deprecated. '
164
        #         'Use instead email.notification.from.email and '
165
        #         'email.notification.from.default_label.'
166
        #     )
167
        #
168
        # self.EMAIL_NOTIFICATION_FROM_EMAIL = settings.get(
169
        #     'email.notification.from.email',
170
        # )
171
        # self.EMAIL_NOTIFICATION_FROM_DEFAULT_LABEL = settings.get(
172
        #     'email.notification.from.default_label'
173
        # )
174
        # self.EMAIL_NOTIFICATION_REPLY_TO_EMAIL = settings.get(
175
        #     'email.notification.reply_to.email',
176
        # )
177
        # self.EMAIL_NOTIFICATION_REFERENCES_EMAIL = settings.get(
178
        #     'email.notification.references.email'
179
        # )
180
        # self.EMAIL_NOTIFICATION_CONTENT_UPDATE_TEMPLATE_HTML = settings.get(
181
        #     'email.notification.content_update.template.html',
182
        # )
183
        # self.EMAIL_NOTIFICATION_CONTENT_UPDATE_TEMPLATE_TEXT = settings.get(
184
        #     'email.notification.content_update.template.text',
185
        # )
186
        # self.EMAIL_NOTIFICATION_CREATED_ACCOUNT_TEMPLATE_HTML = settings.get(
187
        #     'email.notification.created_account.template.html',
188
        #     './tracim/templates/mail/created_account_body_html.mak',
189
        # )
190
        # self.EMAIL_NOTIFICATION_CREATED_ACCOUNT_TEMPLATE_TEXT = settings.get(
191
        #     'email.notification.created_account.template.text',
192
        #     './tracim/templates/mail/created_account_body_text.mak',
193
        # )
194
        # self.EMAIL_NOTIFICATION_CONTENT_UPDATE_SUBJECT = settings.get(
195
        #     'email.notification.content_update.subject',
196
        # )
197
        # self.EMAIL_NOTIFICATION_CREATED_ACCOUNT_SUBJECT = settings.get(
198
        #     'email.notification.created_account.subject',
199
        #     '[{website_title}] Created account',
200
        # )
201
        # self.EMAIL_NOTIFICATION_PROCESSING_MODE = settings.get(
202
        #     'email.notification.processing_mode',
203
        # )
204
        #
205
        self.EMAIL_NOTIFICATION_ACTIVATED = asbool(settings.get(
0 ignored issues
show
Coding Style Naming introduced by
The name EMAIL_NOTIFICATION_ACTIVATED does not conform to the attribute naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
206
            'email.notification.activated',
207
        ))
208
        # self.EMAIL_NOTIFICATION_SMTP_SERVER = settings.get(
209
        #     'email.notification.smtp.server',
210
        # )
211
        # self.EMAIL_NOTIFICATION_SMTP_PORT = settings.get(
212
        #     'email.notification.smtp.port',
213
        # )
214
        # self.EMAIL_NOTIFICATION_SMTP_USER = settings.get(
215
        #     'email.notification.smtp.user',
216
        # )
217
        # self.EMAIL_NOTIFICATION_SMTP_PASSWORD = settings.get(
218
        #     'email.notification.smtp.password',
219
        # )
220
        # self.EMAIL_NOTIFICATION_LOG_FILE_PATH = settings.get(
221
        #     'email.notification.log_file_path',
222
        #     None,
223
        # )
224
        #
225
        # self.EMAIL_REPLY_ACTIVATED = asbool(settings.get(
226
        #     'email.reply.activated',
227
        #     False,
228
        # ))
229
        #
230
        # self.EMAIL_REPLY_IMAP_SERVER = settings.get(
231
        #     'email.reply.imap.server',
232
        # )
233
        # self.EMAIL_REPLY_IMAP_PORT = settings.get(
234
        #     'email.reply.imap.port',
235
        # )
236
        # self.EMAIL_REPLY_IMAP_USER = settings.get(
237
        #     'email.reply.imap.user',
238
        # )
239
        # self.EMAIL_REPLY_IMAP_PASSWORD = settings.get(
240
        #     'email.reply.imap.password',
241
        # )
242
        # self.EMAIL_REPLY_IMAP_FOLDER = settings.get(
243
        #     'email.reply.imap.folder',
244
        # )
245
        # self.EMAIL_REPLY_CHECK_HEARTBEAT = int(settings.get(
246
        #     'email.reply.check.heartbeat',
247
        #     60,
248
        # ))
249
        # self.EMAIL_REPLY_TOKEN = settings.get(
250
        #     'email.reply.token',
251
        # )
252
        # self.EMAIL_REPLY_IMAP_USE_SSL = asbool(settings.get(
253
        #     'email.reply.imap.use_ssl',
254
        # ))
255
        # self.EMAIL_REPLY_IMAP_USE_IDLE = asbool(settings.get(
256
        #     'email.reply.imap.use_idle',
257
        #     True,
258
        # ))
259
        # self.EMAIL_REPLY_CONNECTION_MAX_LIFETIME = int(settings.get(
260
        #     'email.reply.connection.max_lifetime',
261
        #     600,  # 10 minutes
262
        # ))
263
        # self.EMAIL_REPLY_USE_HTML_PARSING = asbool(settings.get(
264
        #     'email.reply.use_html_parsing',
265
        #     True,
266
        # ))
267
        # self.EMAIL_REPLY_USE_TXT_PARSING = asbool(settings.get(
268
        #     'email.reply.use_txt_parsing',
269
        #     True,
270
        # ))
271
        # self.EMAIL_REPLY_LOCKFILE_PATH = settings.get(
272
        #     'email.reply.lockfile_path',
273
        #     ''
274
        # )
275
        # if not self.EMAIL_REPLY_LOCKFILE_PATH and self.EMAIL_REPLY_ACTIVATED:
276
        #     raise Exception(
277
        #         mandatory_msg.format('email.reply.lockfile_path')
278
        #     )
279
        #
280
        # self.EMAIL_PROCESSING_MODE = settings.get(
281
        #     'email.processing_mode',
282
        #     'sync',
283
        # ).upper()
284
        #
285
        # if self.EMAIL_PROCESSING_MODE not in (
286
        #         self.CST.ASYNC,
287
        #         self.CST.SYNC,
288
        # ):
289
        #     raise Exception(
290
        #         'email.processing_mode '
291
        #         'can ''be "{}" or "{}", not "{}"'.format(
292
        #             self.CST.ASYNC,
293
        #             self.CST.SYNC,
294
        #             self.EMAIL_PROCESSING_MODE,
295
        #         )
296
        #     )
297
        #
298
        # self.EMAIL_SENDER_REDIS_HOST = settings.get(
299
        #     'email.async.redis.host',
300
        #     'localhost',
301
        # )
302
        # self.EMAIL_SENDER_REDIS_PORT = int(settings.get(
303
        #     'email.async.redis.port',
304
        #     6379,
305
        # ))
306
        # self.EMAIL_SENDER_REDIS_DB = int(settings.get(
307
        #     'email.async.redis.db',
308
        #     0,
309
        # ))
310
311
        ###
312
        # WSGIDAV (Webdav server)
313
        ###
314
315
        # TODO - G.M - 27-03-2018 - [WebDav] Restore wsgidav config
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
316
        #self.WSGIDAV_CONFIG_PATH = settings.get(
317
        #    'wsgidav.config_path',
318
        #    'wsgidav.conf',
319
        #)
320
        # TODO: Convert to importlib
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
321
        # http://stackoverflow.com/questions/41063938/use-importlib-instead-imp-for-non-py-file
322
        #self.wsgidav_config = imp.load_source(
323
        #    'wsgidav_config',
324
        #    self.WSGIDAV_CONFIG_PATH,
325
        #)
326
        # self.WSGIDAV_PORT = self.wsgidav_config.port
327
        # self.WSGIDAV_CLIENT_BASE_URL = settings.get(
328
        #     'wsgidav.client.base_url',
329
        #     None,
330
        # )
331
        #
332
        # if not self.WSGIDAV_CLIENT_BASE_URL:
333
        #     self.WSGIDAV_CLIENT_BASE_URL = \
334
        #         '{0}:{1}'.format(
335
        #             self.WEBSITE_SERVER_NAME,
336
        #             self.WSGIDAV_PORT,
337
        #         )
338
        #     logger.warning(self,
339
        #         'NOTE: Generated wsgidav.client.base_url parameter with '
340
        #         'followings parameters: website.server_name and '
341
        #         'wsgidav.conf port'.format(
342
        #             self.WSGIDAV_CLIENT_BASE_URL,
343
        #         )
344
        #     )
345
        #
346
        # if not self.WSGIDAV_CLIENT_BASE_URL.endswith('/'):
347
        #     self.WSGIDAV_CLIENT_BASE_URL += '/'
348
349
        # TODO - G.M - 27-03-2018 - [Caldav] Restore radicale config
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
350
        ###
351
        # RADICALE (Caldav server)
352
        ###
353
        # self.RADICALE_SERVER_HOST = settings.get(
354
        #     'radicale.server.host',
355
        #     '127.0.0.1',
356
        # )
357
        # self.RADICALE_SERVER_PORT = int(settings.get(
358
        #     'radicale.server.port',
359
        #     5232,
360
        # ))
361
        # # Note: Other parameters needed to work in SSL (cert file, etc)
362
        # self.RADICALE_SERVER_SSL = asbool(settings.get(
363
        #     'radicale.server.ssl',
364
        #     False,
365
        # ))
366
        # self.RADICALE_SERVER_FILE_SYSTEM_FOLDER = settings.get(
367
        #     'radicale.server.filesystem.folder',
368
        # )
369
        # if not self.RADICALE_SERVER_FILE_SYSTEM_FOLDER:
370
        #     raise Exception(
371
        #         mandatory_msg.format('radicale.server.filesystem.folder')
372
        #     )
373
        # self.RADICALE_SERVER_ALLOW_ORIGIN = settings.get(
374
        #     'radicale.server.allow_origin',
375
        #     None,
376
        # )
377
        # if not self.RADICALE_SERVER_ALLOW_ORIGIN:
378
        #     self.RADICALE_SERVER_ALLOW_ORIGIN = self.WEBSITE_BASE_URL
379
        #     logger.warning(self,
380
        #         'NOTE: Generated radicale.server.allow_origin parameter with '
381
        #         'followings parameters: website.base_url ({0})'
382
        #         .format(self.WEBSITE_BASE_URL)
383
        #     )
384
        #
385
        # self.RADICALE_SERVER_REALM_MESSAGE = settings.get(
386
        #     'radicale.server.realm_message',
387
        #     'Tracim Calendar - Password Required',
388
        # )
389
        #
390
        # self.RADICALE_CLIENT_BASE_URL_HOST = settings.get(
391
        #     'radicale.client.base_url.host',
392
        #     'http://{}:{}'.format(
393
        #         self.RADICALE_SERVER_HOST,
394
        #         self.RADICALE_SERVER_PORT,
395
        #     ),
396
        # )
397
        #
398
        # self.RADICALE_CLIENT_BASE_URL_PREFIX = settings.get(
399
        #     'radicale.client.base_url.prefix',
400
        #     '/',
401
        # )
402
        # # Ensure finished by '/'
403
        # if '/' != self.RADICALE_CLIENT_BASE_URL_PREFIX[-1]:
404
        #     self.RADICALE_CLIENT_BASE_URL_PREFIX += '/'
405
        # if '/' != self.RADICALE_CLIENT_BASE_URL_PREFIX[0]:
406
        #     self.RADICALE_CLIENT_BASE_URL_PREFIX \
407
        #         = '/' + self.RADICALE_CLIENT_BASE_URL_PREFIX
408
        #
409
        # if not self.RADICALE_CLIENT_BASE_URL_HOST:
410
        #     logger.warning(self,
411
        #         'Generated radicale.client.base_url.host parameter with '
412
        #         'followings parameters: website.server_name -> {}'
413
        #         .format(self.WEBSITE_SERVER_NAME)
414
        #     )
415
        #     self.RADICALE_CLIENT_BASE_URL_HOST = self.WEBSITE_SERVER_NAME
416
        #
417
        # self.RADICALE_CLIENT_BASE_URL_TEMPLATE = '{}{}'.format(
418
        #     self.RADICALE_CLIENT_BASE_URL_HOST,
419
        #     self.RADICALE_CLIENT_BASE_URL_PREFIX,
420
        # )
421
422
    def configure_filedepot(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
423
        depot_storage_name = self.DEPOT_STORAGE_NAME
424
        depot_storage_path = self.DEPOT_STORAGE_DIR
425
        depot_storage_settings = {'depot.storage_path': depot_storage_path}
426
        DepotManager.configure(
427
            depot_storage_name,
428
            depot_storage_settings,
429
        )
430
431
    class CST(object):
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
432
        ASYNC = 'ASYNC'
433
        SYNC = 'SYNC'
434
435
        TREEVIEW_FOLDERS = 'folders'
436
        TREEVIEW_ALL = 'all'
437