-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
52 lines (44 loc) · 1.55 KB
/
constants.py
File metadata and controls
52 lines (44 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""Constants for use with Plugins."""
# =============================================================================
# IMPORTS
# =============================================================================
# App
from project_manager.constants import (
ALLOWED_FILE_TYPES,
IMAGE_URL,
LOGO_URL,
READABLE_DATA_FILE_TYPES,
RELEASE_URL,
)
# =============================================================================
# ALL DECLARATION
# =============================================================================
__all__ = (
"PATH_MAX_LENGTH",
"PLUGIN_ALLOWED_FILE_TYPES",
"PLUGIN_DATA_PATH",
"PLUGIN_IMAGE_URL",
"PLUGIN_LOGO_URL",
"PLUGIN_PATH",
"PLUGIN_RELEASE_URL",
"UUID_RE_STRING",
)
# =============================================================================
# GLOBAL VARIABLES
# =============================================================================
# The base path for plugins
PLUGIN_PATH = "addons/source-python/plugins/"
PLUGIN_DATA_PATH = "addons/source-python/data/plugins/"
# The allowed file types by directory for plugins
PLUGIN_ALLOWED_FILE_TYPES = dict(ALLOWED_FILE_TYPES)
PLUGIN_ALLOWED_FILE_TYPES.update({
PLUGIN_PATH + "{self.basename}/": ["py", *READABLE_DATA_FILE_TYPES],
})
PLUGIN_ALLOWED_FILE_TYPES.update({
PLUGIN_DATA_PATH: READABLE_DATA_FILE_TYPES,
})
PLUGIN_IMAGE_URL = IMAGE_URL + "plugins/"
PLUGIN_LOGO_URL = LOGO_URL + "plugins/"
PLUGIN_RELEASE_URL = RELEASE_URL + "plugins/"
PATH_MAX_LENGTH = 256
UUID_RE_STRING = "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}"