-
Notifications
You must be signed in to change notification settings - Fork 17
/
helper.py
executable file
·56 lines (39 loc) · 1.02 KB
/
helper.py
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
53
54
55
56
#!/usr/bin/env python
import sys
def gettext(s):
return s
HELPER_SETTINGS = dict(
INSTALLED_APPS=[
"tests.test_utils",
"tests.test_utils.example1",
"tests.test_utils.example2",
"filer",
"easy_thumbnails",
],
LANGUAGE_CODE="en",
)
try:
import cms # noqa: F401
HELPER_SETTINGS["INSTALLED_APPS"].append("djangocms_text_ckeditor")
except (ImportError, ModuleNotFoundError):
pass
def run():
from app_helper import runner
try:
import cms # noqa: F401 F811
runner.cms("app_helper")
except (ImportError, ModuleNotFoundError):
runner.run("app_helper")
def setup():
from app_helper import runner
try:
import cms # noqa: F401 F811
use_cms = True
except (ImportError, ModuleNotFoundError):
use_cms = False
runner.setup("app_helper", sys.modules[__name__], use_cms=use_cms)
if __name__ == "__main__":
run()
if __name__ == "helper":
# this is needed to run cms_helper in pycharm
setup()