# Path: xpathwebdriver/solve_settings.py
# class ConfigVar(object):
#     def __init__(self, doc=None, default=None, parser=None, experimental=False, env_var=None):
#         self.value = default
#         self.default = default
#         self.parser = parser or self._solve_parser()
#         self.name = None
#         self.doc = doc
#         self.experimental = experimental
#         self._env_var = env_var
# 
#     @property
#     def env_var(self):
#         return self._env_var or 'XPATHWD_' + self.name.upper()
# 
#     def _solve_parser(self):
#         parser = type(self.default)
#         if parser == bool:
#             parser = eval
#         return parser
# 
#     def parse(self, value_str):
#         return self.parser(value_str)
# 
#     def copy(self, value):
#         new_cfg = ConfigVar(self.doc, self.default, self.parser, self.experimental, self._env_var)
#         new_cfg.name = self.name
#         new_cfg.value = value
#         return new_cfg
# 
# class BaseSettings(object):
#     def __init__(self):
#         self._load_env_vars()
# 
#     def _load_env_vars(self):
#         '''
#         Support loading from environment variables
#         '''
#         config_vars = self._get_config_vars()
#         self._wrap_raw_values(config_vars)
#         for env_var, cfg_var in config_vars.items():
#             if env_var in os.environ:
#                 logger.debug('Using %s=%r => %s', env_var, os.environ[env_var], cfg_var.name)
#                 setattr(self, cfg_var.name, cfg_var.copy(cfg_var.parse(os.environ[env_var])))
# 
#     def _wrap_raw_values(self, config_vars):
#         for cfg in config_vars.values():
#             name = cfg.name
#             if hasattr(self, name):
#                 value = getattr(self, name)
#                 if not isinstance(value, ConfigVar):
#                     setattr(self, name, cfg.copy(value))
# 
#     def _get_config_vars(self):
#         config = {}
#         for n in dir(self):
#             if n.startswith('_'):
#                 continue
#             cfg_var = getattr(self, n)
#             if not isinstance(cfg_var, ConfigVar):
#                 cfg_var = self._solve_config_var(n)
#                 if not isinstance(cfg_var, ConfigVar):
#                     logger.warning('Config variable %r not supported (mispelled/deprecated?)', n)
#                     continue
#             cfg_var.name = cfg_var.name or n
#             config[cfg_var.env_var] = cfg_var
#         return config
# 
#     @classmethod
#     def _solve_config_var(cls, attr):
#         cfg_var = getattr(cls, attr, None)
#         if (not isinstance(cfg_var, ConfigVar)
#         and issubclass(cls.__bases__[0], BaseSettings)):
#             return cls.__bases__[0]._solve_config_var(attr)
#         return cfg_var


from xpathwebdriver.solve_settings import ConfigVar, BaseSettings
import logging
# -*- coding: utf-8 -*-
'''
xpathwebdriver
Copyright (c) 2014 Juju. Inc

Code Licensed under MIT License. See LICENSE file.
'''


class DefaultSettings(BaseSettings):

# Path: xpathwebdriver/solve_settings.py
# class ConfigVar(object):
#     def __init__(self, doc=None, default=None, parser=None, experimental=False, env_var=None):
#         self.value = default
#         self.default = default
#         self.parser = parser or self._solve_parser()
#         self.name = None
#         self.doc = doc
#         self.experimental = experimental
#         self._env_var = env_var
# 
#     @property
#     def env_var(self):
#         return self._env_var or 'XPATHWD_' + self.name.upper()
# 
#     def _solve_parser(self):
#         parser = type(self.default)
#         if parser == bool:
#             parser = eval
#         return parser
# 
#     def parse(self, value_str):
#         return self.parser(value_str)
# 
#     def copy(self, value):
#         new_cfg = ConfigVar(self.doc, self.default, self.parser, self.experimental, self._env_var)
#         new_cfg.name = self.name
#         new_cfg.value = value
#         return new_cfg
# 
# class BaseSettings(object):
#     def __init__(self):
#         self._load_env_vars()
# 
#     def _load_env_vars(self):
#         '''
#         Support loading from environment variables
#         '''
#         config_vars = self._get_config_vars()
#         self._wrap_raw_values(config_vars)
#         for env_var, cfg_var in config_vars.items():
#             if env_var in os.environ:
#                 logger.debug('Using %s=%r => %s', env_var, os.environ[env_var], cfg_var.name)
#                 setattr(self, cfg_var.name, cfg_var.copy(cfg_var.parse(os.environ[env_var])))
# 
#     def _wrap_raw_values(self, config_vars):
#         for cfg in config_vars.values():
#             name = cfg.name
#             if hasattr(self, name):
#                 value = getattr(self, name)
#                 if not isinstance(value, ConfigVar):
#                     setattr(self, name, cfg.copy(value))
# 
#     def _get_config_vars(self):
#         config = {}
#         for n in dir(self):
#             if n.startswith('_'):
#                 continue
#             cfg_var = getattr(self, n)
#             if not isinstance(cfg_var, ConfigVar):
#                 cfg_var = self._solve_config_var(n)
#                 if not isinstance(cfg_var, ConfigVar):
#                     logger.warning('Config variable %r not supported (mispelled/deprecated?)', n)
#                     continue
#             cfg_var.name = cfg_var.name or n
#             config[cfg_var.env_var] = cfg_var
#         return config
# 
#     @classmethod
#     def _solve_config_var(cls, attr):
#         cfg_var = getattr(cls, attr, None)
#         if (not isinstance(cfg_var, ConfigVar)
#         and issubclass(cls.__bases__[0], BaseSettings)):
#             return cls.__bases__[0]._solve_config_var(attr)
#         return cfg_var


# Path: xpathwebdriver/default_settings.py
from xpathwebdriver.solve_settings import ConfigVar, BaseSettings
import logging

# -*- coding: utf-8 -*-
'''
xpathwebdriver
Copyright (c) 2014 Juju. Inc

Code Licensed under MIT License. See LICENSE file.
'''


class DefaultSettings(BaseSettings):

    base_url = ConfigVar(