forked from Charcoal-SE/SmokeDetector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugging.py
More file actions
44 lines (33 loc) · 1.13 KB
/
debugging.py
File metadata and controls
44 lines (33 loc) · 1.13 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
import os
# noinspection PyClassHasNoInit,PyDeprecation
class Debugging:
enabled = None
pydev_host = None
pydev_port = None
environ_str = None
environ_args = None
_envpydev = str(os.environ.get('PYDEVD')).lower()
if not _envpydev:
enabled = False
elif _envpydev.__contains__('true') or _envpydev.__contains__('enable') or _envpydev.__contains__('yes'):
enabled = True
environ_str = "PYDEVD='%s'" % 'True'
host = os.environ.get('PYDEVD_HOST')
if not host:
pydev_host = 'localhost'
else:
pydev_host = str(host)
if pydev_host != 'localhost':
environ_str += " PYDEVD_HOST='%s'" % pydev_host
port = os.environ.get('PYDEVD_PORT')
if not port:
pydev_port = 20500
else:
pydev_port = int(port)
if pydev_port != 20500:
environ_str += " PYDEVD_PORT='%s'" % pydev_port
environ_args = environ_str.split()
environ_str += " "
environ_dict = {'PYDEVD': enabled, 'PYDEVD_HOST': pydev_host, 'PYDEVD_PORT': pydev_port}
else:
enabled = False