1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 from __future__ import absolute_import
17 """Exception raised if an exception is find
18 Those Types of error will stop nicely in the cmd interface"""
19
21 """a class for the invalid syntax call"""
22
25
26 import os
27 import logging
28 import time
29
30
31 MG5DIR = os.path.realpath(os.path.join(os.path.dirname(__file__),
32 os.path.pardir))
33 if ' ' in MG5DIR:
34 logging.critical('''\033[1;31mpath to MG5: "%s" contains space.
35 This is likely to create code unstability.
36 Please consider changing the path location of the code\033[0m''' % MG5DIR)
37 time.sleep(1)
38 MG4DIR = MG5DIR
39 ReadWrite = os.access(MG5DIR, os.W_OK)
40
41 if ReadWrite:
42
43 try:
44 tmp_path = pjoin(MG5DIR, 'Template','LO','Source','make_opts')
45
46 if os.path.exists(tmp_path) and os.path.getmtime(tmp_path) < 1480375724:
47 os.remove(tmp_path)
48 shutil.copy(pjoin(MG5DIR, 'Template','LO','Source','.make_opts'),
49 pjoin(MG5DIR, 'Template','LO','Source','make_opts'))
50 except Exception as error:
51 pass
52
53 ADMIN_DEBUG = False
54 if os.path.exists(os.path.join(MG5DIR,'bin', 'create_release.py')):
55 if os.path.exists(os.path.join(MG5DIR,'.bzr')):
56 ADMIN_DEBUG = True
57