forked from progrium/ginkgo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
32 lines (27 loc) · 802 Bytes
/
Copy path__init__.py
File metadata and controls
32 lines (27 loc) · 802 Bytes
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
try:
from .config import Config as _Config
except ImportError:
# Avoid dependencies when
# running setup.py
class _Config:
setting = None
from .core import Service
__author__ = "Jeff Lindsay <jeff.lindsay@twilio.com>"
__license__ = "MIT"
__version__ = ".".join(map(str, (0, 5, 0)))
process = None
settings = _Config()
Setting = settings.setting
_processes = []
def push_process(new_process):
"""Internal function to set the process singleton"""
_processes.append(process)
process = new_process
settings = process.config
Setting = settings.setting
def pop_process():
"""Internal function to unset the process singleton"""
if len(_processes):
process = _processes.pop()
settings = process.config
Setting = settings.setting