<s> """<STR_LIT>""" <EOL> import os <EOL> import json <EOL> PACKAGE_DIR = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> ROOT_DIR = os . path . dirname ( PACKAGE_DIR ) <EOL> LOG_ROOT = os . path . join ( os . path . expanduser ( '<STR_LIT>' ) , '<STR_LIT>' , '<STR_LIT>' ) <EOL> ROOT_PLUGINS_PACKAGE = '<STR_LIT>' <EOL> MAX_LOG_SIZE = <NUM_LIT> * <NUM_LIT> * <NUM_LIT:10> <EOL> LOG_BACKUP_COUNT = <NUM_LIT:5> <EOL> TEXT_SCORE_SORT_MAX = <NUM_LIT:200> <EOL> VERSION = { <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:date>' : None <EOL> } <EOL> try : <EOL> with open ( os . path . join ( PACKAGE_DIR , '<STR_LIT>' ) ) as f : <EOL> VERSION . update ( json . load ( f ) ) <EOL> except IOError : <EOL> pass <EOL> STATIC_ROOT_DIR = ROOT_DIR <EOL> if not os . path . exists ( os . path . join ( STATIC_ROOT_DIR , '<STR_LIT>' ) ) : <EOL> STATIC_ROOT_DIR = PACKAGE_DIR <EOL> class TerminalColor ( object ) : <EOL> """<STR_LIT>""" <EOL> ERROR = '<STR_LIT>' <EOL> SUCCESS = '<STR_LIT>' <EOL> WARNING = '<STR_LIT>' <EOL> INFO = '<STR_LIT>' <EOL> ENDC = '<STR_LIT>' <EOL> @ staticmethod <EOL> def _color ( tag , text ) : <EOL> return '<STR_LIT>' . join ( [ tag , text , TerminalColor . ENDC ] ) <EOL> @ staticmethod <EOL> def error ( text ) : <EOL> return TerminalColor . _color ( TerminalColor . ERROR , text ) <EOL> @ staticmethod <EOL> def success ( text ) : <EOL> return TerminalColor . _color ( TerminalColor . SUCCESS , text ) <EOL> @ staticmethod <EOL> def warning ( text ) : <EOL> return TerminalColor . _color ( TerminalColor . WARNING , text ) <EOL> @ staticmethod <EOL> def info ( text ) : <EOL> return TerminalColor . _color ( TerminalColor . INFO , text ) <EOL> class AssetstoreType : <EOL> """<STR_LIT>""" <EOL> FILESYSTEM = <NUM_LIT:0> <EOL> GRIDFS = <NUM_LIT:1> <EOL> S3 = <NUM_LIT:2> <EOL> class AccessType : <EOL> """<STR_LIT>""" <EOL> NONE = - <NUM_LIT:1> <EOL> READ = <NUM_LIT:0> <EOL> WRITE = <NUM_LIT:1> <EOL> ADMIN = <NUM_LIT:2> <EOL> SITE_ADMIN = <NUM_LIT:100> <EOL> @ classmethod <EOL> def validate ( cls , level ) : <EOL> level = int ( level ) <EOL> if level in ( cls . NONE , cls . READ , cls . WRITE , cls . ADMIN , cls . SITE_ADMIN ) : <EOL> return level <EOL> else : <EOL> raise ValueError ( '<STR_LIT>' % level ) <EOL> class SettingKey : <EOL> """<STR_LIT>""" <EOL> PLUGINS_ENABLED = '<STR_LIT>' <EOL> COOKIE_LIFETIME = '<STR_LIT>' <EOL> EMAIL_FROM_ADDRESS = '<STR_LIT>' <EOL> EMAIL_HOST = '<STR_LIT>' <EOL> REGISTRATION_POLICY = '<STR_LIT>' <EOL> SMTP_HOST = '<STR_LIT>' <EOL> SMTP_PORT = '<STR_LIT>' <EOL> SMTP_ENCRYPTION = '<STR_LIT>' <EOL> SMTP_USERNAME = '<STR_LIT>' <EOL> SMTP_PASSWORD = '<STR_LIT>' <EOL> UPLOAD_MINIMUM_CHUNK_SIZE = '<STR_LIT>' <EOL> CORS_ALLOW_ORIGIN = '<STR_LIT>' <EOL> CORS_ALLOW_METHODS = '<STR_LIT>' <EOL> CORS_ALLOW_HEADERS = '<STR_LIT>' <EOL> ADD_TO_GROUP_POLICY = '<STR_LIT>' <EOL> COLLECTION_CREATE_POLICY = '<STR_LIT>' <EOL> USER_DEFAULT_FOLDERS = '<STR_LIT>' <EOL> class SettingDefault : <EOL> """<STR_LIT>""" <EOL> defaults = { <EOL> SettingKey . PLUGINS_ENABLED : [ ] , <EOL> SettingKey . COOKIE_LIFETIME : <NUM_LIT> , <EOL> SettingKey . EMAIL_FROM_ADDRESS : '<STR_LIT>' , <EOL> SettingKey . REGISTRATION_POLICY : '<STR_LIT>' , <EOL> SettingKey . SMTP_HOST : '<STR_LIT:localhost>' , <EOL> SettingKey . SMTP_PORT : <NUM_LIT> , <EOL> SettingKey . SMTP_ENCRYPTION : '<STR_LIT:none>' , <EOL> SettingKey . UPLOAD_MINIMUM_CHUNK_SIZE : <NUM_LIT> * <NUM_LIT> * <NUM_LIT:5> , <EOL> SettingKey . CORS_ALLOW_HEADERS : <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> SettingKey . ADD_TO_GROUP_POLICY : '<STR_LIT>' , <EOL> SettingKey . COLLECTION_CREATE_POLICY : { <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : [ ] <EOL> } , <EOL> SettingKey . USER_DEFAULT_FOLDERS : '<STR_LIT>' <EOL> } <EOL> class SortDir ( object ) : <EOL> ASCENDING = <NUM_LIT:1> <EOL> DESCENDING = - <NUM_LIT:1> <EOL> class TokenScope : <EOL> """<STR_LIT>""" <EOL> ANONYMOUS_SESSION = '<STR_LIT>' <EOL> USER_AUTH = '<STR_LIT>' <EOL> TEMPORARY_USER_AUTH = '<STR_LIT>' <EOL> PLUGINS_ENABLED_READ = '<STR_LIT>' <EOL> SETTINGS_READ = '<STR_LIT>' <EOL> ASSETSTORES_READ = '<STR_LIT>' <EOL> PARTIAL_UPLOAD_READ = '<STR_LIT>' <EOL> PARTIAL_UPLOAD_CLEAN = '<STR_LIT>' <EOL> DATA_READ = '<STR_LIT>' <EOL> class CoreEventHandler ( object ) : <EOL> """<STR_LIT>""" <EOL> ACCESS_CONTROL_CLEANUP = '<STR_LIT>' <EOL> FILE_PROPAGATE_SIZE = '<STR_LIT>' <EOL> GROUP_CREATOR_ACCESS = '<STR_LIT>' <EOL> USER_DEFAULT_FOLDERS = '<STR_LIT>' <EOL> USER_SELF_ACCESS = '<STR_LIT>' </s>
