# Path: m2core/common/options.py
# class M2OptionParser(OptionParser):
#     def parse_environment(self, final=True):


from m2core.common.options import options
options.define('log_file', default='/logs.txt', help='Path to log file', type=str)
options.define('locale', default='ru_RU.UTF-8', help='Server locale for dates, times, currency and etc', type=str)
options.define('access_token_param', default='at', help='Name of access token param to search for in request',
               type=str)

# - database config
options.define('pg_host', default='127.0.0.1', help='Database host', type=str)
options.define('pg_port', default=5432, help='Database port', type=int)
options.define('pg_db', default='m2core', help='Database name', type=str)
options.define('pg_user', default='postgres', help='Database user', type=str)
options.define('pg_password', default='password', help='Database password', type=str)
options.define('pg_pool_size', default=40, help='Pool size for bg executor', type=int)
options.define('pg_pool_recycle', default=-1, help='Pool recycle time in sec, -1 - disable', type=int)
options.define('expire_on_connect', default=True, help='Expire sqlalchemy inner cache when initializing BaseHandler '
                                                       'for incoming client', type=bool)
# - redis config
options.define('redis_host', default='127.0.0.1', help='Redis host', type=str)
options.define('redis_port', default=6379, help='Redis port', type=int)
options.define('redis_db', default=0, help='Redis database number (0-15)', type=int)

# - additional kwargs for different kind of classes
options.define('redis_connection_pool_kwargs', default={},
               help='Additional kwargs used when initializing Connection Pool for Redis', type=dict)
options.define('engine_kwargs', default={}, help='Additional kwargs used when initializing SQLAlchemy engine',
               type=dict)
options.define('session_kwargs', default={}, help='Additional kwargs used when initializing SQLAlchemy session',
               type=dict)
options.define('tornado_application_kwargs', default={}, help='Additional kwargs used when initializing Tornado app',
               type=dict)
options.define('http_server_kwargs', default={'xheaders': True},

# Path: m2core/common/options.py
# class M2OptionParser(OptionParser):
#     def parse_environment(self, final=True):


# Path: m2core/app_env.py
from m2core.common.options import options

options.define('log_file', default='/logs.txt', help='Path to log file', type=str)
options.define('locale', default='ru_RU.UTF-8', help='Server locale for dates, times, currency and etc', type=str)
options.define('access_token_param', default='at', help='Name of access token param to search for in request',
               type=str)

# - database config
options.define('pg_host', default='127.0.0.1', help='Database host', type=str)
options.define('pg_port', default=5432, help='Database port', type=int)
options.define('pg_db', default='m2core', help='Database name', type=str)
options.define('pg_user', default='postgres', help='Database user', type=str)
options.define('pg_password', default='password', help='Database password', type=str)
options.define('pg_pool_size', default=40, help='Pool size for bg executor', type=int)
options.define('pg_pool_recycle', default=-1, help='Pool recycle time in sec, -1 - disable', type=int)
options.define('expire_on_connect', default=True, help='Expire sqlalchemy inner cache when initializing BaseHandler '
                                                       'for incoming client', type=bool)
# - redis config
options.define('redis_host', default='127.0.0.1', help='Redis host', type=str)
options.define('redis_port', default=6379, help='Redis port', type=int)
options.define('redis_db', default=0, help='Redis database number (0-15)', type=int)

# - additional kwargs for different kind of classes
options.define('redis_connection_pool_kwargs', default={},
               help='Additional kwargs used when initializing Connection Pool for Redis', type=dict)
options.define('engine_kwargs', default={}, help='Additional kwargs used when initializing SQLAlchemy engine',
               type=dict)
options.define('session_kwargs', default={}, help='Additional kwargs used when initializing SQLAlchemy session',
               type=dict)
options.define('tornado_application_kwargs', default={}, help='Additional kwargs used when initializing Tornado app',
               type=dict)
options.define('http_server_kwargs', default={'xheaders': True},

               help='Additional kwargs used when initializing HTTP server', type=dict)