本文整理汇总了Python中six.moves.configparser.ConfigParser.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigParser.__init__方法的具体用法?Python ConfigParser.__init__怎么用?Python ConfigParser.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类six.moves.configparser.ConfigParser
的用法示例。
在下文中一共展示了ConfigParser.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from six.moves.configparser import ConfigParser [as 别名]
# 或者: from six.moves.configparser.ConfigParser import __init__ [as 别名]
def __init__(self, *args, **kwargs):
if sys.version_info[0] == 2:
if sys.version_info[:2] >= (2, 6):
# SafeConfigParser(dict_type=) supported in 2.6+
kwargs["dict_type"] = SortedDict
ConfigParser.__init__(self, *args, **kwargs)
else:
kwargs["dict_type"] = SortedDict
super(SortedConfigParser, self).__init__(*args, **kwargs)
self.seen = set()
示例2: __init__
# 需要导入模块: from six.moves.configparser import ConfigParser [as 别名]
# 或者: from six.moves.configparser.ConfigParser import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self.fpath = os.path.expanduser(self.strip_kwarg(kwargs, 'fpath'))
self.section = self.strip_kwarg(kwargs, 'section')
initvals = self.strip_kwarg(kwargs, 'initvals')
self.header = self.strip_kwarg(kwargs, 'header')
ConfigParser.__init__(self, *args, **kwargs)
self.add_section(self.section)
for option in initvals:
self.set(self.section, option, initvals[option])
self.read(self.fpath)
self.save()
示例3: __init__
# 需要导入模块: from six.moves.configparser import ConfigParser [as 别名]
# 或者: from six.moves.configparser.ConfigParser import __init__ [as 别名]
def __init__(self, base_folder, storage_folder=None, environment=os.environ):
ConfigParser.__init__(self)
self.conan_folder = os.path.join(base_folder, '.conan_server')
self.config_filename = os.path.join(self.conan_folder, 'server.conf')
self._loaded = False
self.env_config = {"updown_secret": get_env("CONAN_UPDOWN_SECRET", None, environment),
"store_adapter": get_env("CONAN_STORE_ADAPTER", None, environment),
"authorize_timeout": get_env("CONAN_AUTHORIZE_TIMEOUT", None, environment),
"disk_storage_path": get_env("CONAN_STORAGE_PATH", storage_folder, environment),
"jwt_secret": get_env("CONAN_JWT_SECRET", None, environment),
"jwt_expire_minutes": get_env("CONAN_JWT_EXPIRE_MINUTES", None, environment),
"write_permissions": [],
"read_permissions": [],
"ssl_enabled": get_env("CONAN_SSL_ENABLED", None, environment),
"port": get_env("CONAN_SERVER_PORT", None, environment),
"public_port": get_env("CONAN_SERVER_PUBLIC_PORT", None, environment),
"host_name": get_env("CONAN_HOST_NAME", None, environment),
# "user:pass,user2:pass2"
"users": get_env("CONAN_SERVER_USERS", None, environment)}
示例4: __init__
# 需要导入模块: from six.moves.configparser import ConfigParser [as 别名]
# 或者: from six.moves.configparser.ConfigParser import __init__ [as 别名]
def __init__(self, filename, *args, **kw):
ConfigParser.__init__(self, *args, **kw)
self.filename = filename
if hasattr(self, '_interpolation'):
self._interpolation = self.InterpolateWrapper(self._interpolation)
示例5: __init__
# 需要导入模块: from six.moves.configparser import ConfigParser [as 别名]
# 或者: from six.moves.configparser.ConfigParser import __init__ [as 别名]
def __init__(self, filename):
ConfigParser.__init__(self)
self.read(filename)
示例6: __init__
# 需要导入模块: from six.moves.configparser import ConfigParser [as 别名]
# 或者: from six.moves.configparser.ConfigParser import __init__ [as 别名]
def __init__(self, *args, **kwargs):
ConfigParser.__init__(self, *args, **kwargs)
self.breakpoints_cnt = 0
self.mmaps_cnt = 0
self.devices_cnt = 0