You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.0 KiB

from couchpotato.core.loader import Loader
from couchpotato.core.settings import Settings
class Env:
14 years ago
''' Environment variables '''
_debug = False
_settings = Settings()
_loader = Loader()
_cache = None
_options = None
_args = None
_quiet = False
14 years ago
_deamonize = False
_version = 0.5
14 years ago
''' Data paths and directories '''
_app_dir = ""
_data_dir = ""
_cache_dir = ""
_db_path = ""
_log_path = ""
@staticmethod
def doDebug():
return Env._debug
@staticmethod
def get(attr):
return getattr(Env, '_' + attr)
@staticmethod
def set(attr, value):
return setattr(Env, '_' + attr, value)
14 years ago
@staticmethod
def setting(attr, section = 'core', value = None, default = ''):
14 years ago
# Return setting
if value == None:
return Env.get('settings').get(attr, default = default, section = section)
# Set setting
s = Env.get('settings')
s.set(section, attr, value)
return s