三个重要的模块loggning,hashlib,configparse

##1.hashilb模块
##将字符串bytes类型变为hash值,
##摘要算法,用于网络上传下载鉴别文件一致性,用于安全登录,
##import hashlib
##a = "alex"
##b= "alex1"
##
##md5_obj = hashlib.md5()
##
##md5_obj.update(a.encode("utf-8"))
##
##res = md5_obj.hexdigest()
##print(res)#534b44a19bf18d20b71ecc4eb77c572f

 

 

 

 

##官方文档解释
#hashlib模块是,hash函数公共接口.

new(name, data=b'', **kwargs) - returns a new hash object implementing#执行 the
given#给到的 hash function; initializing the hash using the given binary#二进制 data.
#new(名字,数据,容器类参数) 返回一个新的哈希对象,执行这个给到的hash函数可以更快的得到二进制
Named#命名 constructor#构造函数 functions#功能 are also available, these are#这些\是 faster#更快的
han using new(name)

 

#可散列的类型
md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(),
sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256.
#如果你想使用 adler32 或者crc32 离散函数 它们可以在 zlib模块中找到

 


More algorithms#算法 may be available on your platform but the above are guaranteed#担保
to exist. See the algorithms _guaranteed and algorithms_available#可用的 attributes#属性
to find out#找出 what algorithm names can be passed#传递 to new().

 




Choose your hash function wisely#明智的. Some have known collision#冲突 weaknesses#劣势.
sha384 and sha512 will be#将要 slow#慢的 on 32 bit platforms.



Hash objects have these methods:#离散对象有这些方法
1.update(自变量(bytes类型))#更新方法
- update(arg): Update the hash object with the bytes in arg. Repeated#重复 calls
are equivalent#等价的 to a single call with the concatenation#串联,联结 of all
the arguments#参数.
#将bytes参数转换为离散对象, 对于同一参数,转换多次的值和转换一次的值相等.


2.digest()#摘要方法
#返回一个目前为止通过update()方法的bytes摘要
- digest(): Return the digest of the bytes passed to the update() method
so far#到目前为止.

3.hexdigest()#魔法摘要方法 hex在美国为对...使用魔法的意思
#类似于digest,返回一个除了bytes的unicode对象,对象限定为双倍unicode长度且十六进制
- hexdigest(): Like digest() except the digest is returned as a unicode
object of double length, containing only hexadecimal digits.


4.copy()#复制方法
#返回一个离散对象的复制,这个能用于将目标字符串快速共享到其他电脑.
- copy(): Return a copy (clone) of the hash object. This can be used to
efficiently compute the digests of strings that share a common
initial substring.

 



For example, to obtain#获得 the digest of the string 'Nobody inspects the
spammish repetition':
#例如获得'Nobody inspects thespammish repetition'这个字符串的摘要

>>> import hashlib#调用模块
>>> m = hashlib.md5()#定义一个散列类型
>>> m.update(b"Nobody inspects")#将字符串更新为散列
>>> m.update(b" the spammish repetition")
>>> m.digest()#获得十六进制
b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'

More condensed:
>>>hashlib.md5.update("alex").hexdigest

>>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

 

CLASSES
builtins.object
_blake2.blake2b
_blake2.blake2s
_sha3.sha3_224
_sha3.sha3_256
_sha3.sha3_384
_sha3.sha3_512
_sha3.shake_128
_sha3.shake_256

class blake2b(builtins.object)
| Return a new BLAKE2b hash object.
|
| Methods defined here:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| copy(self, /)
| Return a copy of the hash object.
|
| digest(self, /)
| Return the digest value as a string of binary data.
|
| hexdigest(self, /)
| Return the digest value as a string of hexadecimal digits.
|
| update(self, obj, /)
| Update this hash object's state with the provided string.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| block_size
|
| digest_size
|
| name
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| MAX_DIGEST_SIZE = 64
|
| MAX_KEY_SIZE = 64
|
| PERSON_SIZE = 16
|
| SALT_SIZE = 16

class blake2s(builtins.object)
| Return a new BLAKE2s hash object.
|
| Methods defined here:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| copy(self, /)
| Return a copy of the hash object.
|
| digest(self, /)
| Return the digest value as a string of binary data.
|
| hexdigest(self, /)
| Return the digest value as a string of hexadecimal digits.
|
| update(self, obj, /)
| Update this hash object's state with the provided string.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| block_size
|
| digest_size
|
| name
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| MAX_DIGEST_SIZE = 32
|
| MAX_KEY_SIZE = 32
|
| PERSON_SIZE = 8
|
| SALT_SIZE = 8

class sha3_224(builtins.object)
| Return a new SHA3 hash object with a hashbit length of 28 bytes.
|
| Methods defined here:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| copy(self, /)
| Return a copy of the hash object.
|
| digest(self, /)
| Return the digest value as a string of binary data.
|
| hexdigest(self, /)
| Return the digest value as a string of hexadecimal digits.
|
| update(self, obj, /)
| Update this hash object's state with the provided string.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| block_size
|
| digest_size
|
| name

class sha3_256(builtins.object)
| sha3_256([string]) -> SHA3 object
|
| Return a new SHA3 hash object with a hashbit length of 32 bytes.
|
| Methods defined here:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| copy(self, /)
| Return a copy of the hash object.
|
| digest(self, /)
| Return the digest value as a string of binary data.
|
| hexdigest(self, /)
| Return the digest value as a string of hexadecimal digits.
|
| update(self, obj, /)
| Update this hash object's state with the provided string.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| block_size
|
| digest_size
|
| name

class sha3_384(builtins.object)
| sha3_384([string]) -> SHA3 object
|
| Return a new SHA3 hash object with a hashbit length of 48 bytes.
|
| Methods defined here:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| copy(self, /)
| Return a copy of the hash object.
|
| digest(self, /)
| Return the digest value as a string of binary data.
|
| hexdigest(self, /)
| Return the digest value as a string of hexadecimal digits.
|
| update(self, obj, /)
| Update this hash object's state with the provided string.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| block_size
|
| digest_size
|
| name

class sha3_512(builtins.object)
| sha3_512([string]) -> SHA3 object
|
| Return a new SHA3 hash object with a hashbit length of 64 bytes.
|
| Methods defined here:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| copy(self, /)
| Return a copy of the hash object.
|
| digest(self, /)
| Return the digest value as a string of binary data.
|
| hexdigest(self, /)
| Return the digest value as a string of hexadecimal digits.
|
| update(self, obj, /)
| Update this hash object's state with the provided string.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| block_size
|
| digest_size
|
| name

class shake_128(builtins.object)
| shake_128([string]) -> SHAKE object
|
| Return a new SHAKE hash object.
|
| Methods defined here:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| copy(self, /)
| Return a copy of the hash object.
|
| digest(self, /, length)
| Return the digest value as a string of binary data.
|
| hexdigest(self, /, length)
| Return the digest value as a string of hexadecimal digits.
|
| update(self, obj, /)
| Update this hash object's state with the provided string.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| block_size
|
| digest_size
|
| name

class shake_256(builtins.object)
| shake_256([string]) -> SHAKE object
|
| Return a new SHAKE hash object.
|
| Methods defined here:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| copy(self, /)
| Return a copy of the hash object.
|
| digest(self, /, length)
| Return the digest value as a string of binary data.
|
| hexdigest(self, /, length)
| Return the digest value as a string of hexadecimal digits.
|
| update(self, obj, /)
| Update this hash object's state with the provided string.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| block_size
|
| digest_size
|
| name

 

FUNCTIONS#功能 函数
md5 = openssl_md5(...)
Returns a md5 hash object; optionally initialized with a string
#返回一个md5散列对象.可用于字符串初始化
new = __hash_new(name, data=b'', **kwargs)
new(name, data=b'') - Return a new hashing object using the named algorithm;
optionally initialized with data (which must be bytes).

pbkdf2_hmac(...)
pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) -> key

Password based key derivation function 2 (PKCS #5 v2.0) with HMAC as
pseudorandom function.

sha1 = openssl_sha1(...)
Returns a sha1 hash object; optionally initialized with a string

sha224 = openssl_sha224(...)
Returns a sha224 hash object; optionally initialized with a string

sha256 = openssl_sha256(...)
Returns a sha256 hash object; optionally initialized with a string

sha384 = openssl_sha384(...)
Returns a sha384 hash object; optionally initialized with a string

sha512 = openssl_sha512(...)
Returns a sha512 hash object; optionally initialized with a string

DATA
__all__ = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'bla...
algorithms_available = {'DSA', 'DSA-SHA', 'MD4', 'MD5', 'RIPEMD160', '...
algorithms_guaranteed = {'blake2b', 'blake2s', 'md5', 'sha1', 'sha224'...

FILE
c:\python36\lib\hashlib.py

 

 

 


##2.loggning模块
##用于系统日志操作
##使日志更加规范,等级更加鲜明
##等级分为五个等级
##1.调试
##2.测试
##3.警告
##4.错误
##5.严重警告

 

#官方帮助文档解释
logging#记录

To use, simply 'import logging' and log away!#简单的导入logging模块,马上记录

PACKAGE CONTENTS
config#配置,布局
handlers#操作



class BufferingFormatter(builtins.object)
| A formatter suitable for formatting a number of records.
|
| Methods defined here:
|
| __init__(self, linefmt=None)
| Optionally specify a formatter which will be used to format each
| individual record.
|
| format(self, records)
| Format the specified records and return the result as a string.
|
| formatFooter(self, records)
| Return the footer string for the specified records.
|
| formatHeader(self, records)
| Return the header string for the specified records.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class FileHandler(StreamHandler)
| A handler class which writes formatted logging records to disk files.
|
| Method resolution order:
| FileHandler
| StreamHandler
| Handler
| Filterer
| builtins.object
|
| Methods defined here:
|
| __init__(self, filename, mode='a', encoding=None, delay=False)
| Open the specified file and use it as the stream for logging.
|
| __repr__(self)
| Return repr(self).
|
| close(self)
| Closes the stream.
|
| emit(self, record)
| Emit a record.
|
| If the stream was not opened because 'delay' was specified in the
| constructor, open it before calling the superclass's emit.
|
| ----------------------------------------------------------------------
| Methods inherited from StreamHandler:
|
| flush(self)
| Flushes the stream.
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from StreamHandler:
|
| terminator = '\n'
|
| ----------------------------------------------------------------------
| Methods inherited from Handler:
|
| acquire(self)
| Acquire the I/O thread lock.
|
| createLock(self)
| Acquire a thread lock for serializing access to the underlying I/O.
|
| format(self, record)
| Format the specified record.
|
| If a formatter is set, use it. Otherwise, use the default formatter
| for the module.
|
| get_name(self)
|
| handle(self, record)
| Conditionally emit the specified logging record.
|
| Emission depends on filters which may have been added to the handler.
| Wrap the actual emission of the record with acquisition/release of
| the I/O thread lock. Returns whether the filter passed the record for
| emission.
|
| handleError(self, record)
| Handle errors which occur during an emit() call.
|
| This method should be called from handlers when an exception is
| encountered during an emit() call. If raiseExceptions is false,
| exceptions get silently ignored. This is what is mostly wanted
| for a logging system - most users will not care about errors in
| the logging system, they are more interested in application errors.
| You could, however, replace this with a custom handler if you wish.
| The record which was being processed is passed in to this method.
|
| release(self)
| Release the I/O thread lock.
|
| setFormatter(self, fmt)
| Set the formatter for this handler.
|
| setLevel(self, level)
| Set the logging level of this handler. level must be an int or a str.
|
| set_name(self, name)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Handler:
|
| name
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this and the record is then dropped. Returns a zero value if a record
| is to be dropped, else non-zero.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class Filter(builtins.object)
| Filter instances are used to perform arbitrary filtering of LogRecords.
|
| Loggers and Handlers can optionally use Filter instances to filter
| records as desired. The base filter class only allows events which are
| below a certain point in the logger hierarchy. For example, a filter
| initialized with "A.B" will allow events logged by loggers "A.B",
| "A.B.C", "A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If
| initialized with the empty string, all events are passed.
|
| Methods defined here:
|
| __init__(self, name='')
| Initialize a filter.
|
| Initialize with the name of the logger which, together with its
| children, will have its events allowed through the filter. If no
| name is specified, allow every event.
|
| filter(self, record)
| Determine if the specified record is to be logged.
|
| Is the specified record to be logged? Returns 0 for no, nonzero for
| yes. If deemed appropriate, the record may be modified in-place.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class Formatter(builtins.object)
| Formatter instances are used to convert a LogRecord to text.
|
| Formatters need to know how a LogRecord is constructed. They are
| responsible for converting a LogRecord to (usually) a string which can
| be interpreted by either a human or an external system. The base Formatter
| allows a formatting string to be specified. If none is supplied, the
| default value of "%s(message)" is used.
|
| The Formatter can be initialized with a format string which makes use of
| knowledge of the LogRecord attributes - e.g. the default value mentioned
| above makes use of the fact that the user's message and arguments are pre-
| formatted into a LogRecord's message attribute. Currently, the useful
| attributes in a LogRecord are described by:
|
| %(name)s Name of the logger (logging channel)
| %(levelno)s Numeric logging level for the message (DEBUG, INFO,
| WARNING, ERROR, CRITICAL)
| %(levelname)s Text logging level for the message ("DEBUG", "INFO",
| "WARNING", "ERROR", "CRITICAL")
| %(pathname)s Full pathname of the source file where the logging
| call was issued (if available)
| %(filename)s Filename portion of pathname
| %(module)s Module (name portion of filename)
| %(lineno)d Source line number where the logging call was issued
| (if available)
| %(funcName)s Function name
| %(created)f Time when the LogRecord was created (time.time()
| return value)
| %(asctime)s Textual time when the LogRecord was created
| %(msecs)d Millisecond portion of the creation time
| %(relativeCreated)d Time in milliseconds when the LogRecord was created,
| relative to the time the logging module was loaded
| (typically at application startup time)
| %(thread)d Thread ID (if available)
| %(threadName)s Thread name (if available)
| %(process)d Process ID (if available)
| %(message)s The result of record.getMessage(), computed just as
| the record is emitted
|
| Methods defined here:
|
| __init__(self, fmt=None, datefmt=None, style='%')
| Initialize the formatter with specified format strings.
|
| Initialize the formatter either with the specified format string, or a
| default as described above. Allow for specialized date formatting with
| the optional datefmt argument (if omitted, you get the ISO8601 format).
|
| Use a style parameter of '%', '{' or '$' to specify that you want to
| use one of %-formatting, :meth:`str.format` (``{}``) formatting or
| :class:`string.Template` formatting in your format string.
|
| .. versionchanged:: 3.2
| Added the ``style`` parameter.
|
| converter = localtime(...)
| localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,
| tm_sec,tm_wday,tm_yday,tm_isdst)
|
| Convert seconds since the Epoch to a time tuple expressing local time.
| When 'seconds' is not passed in, convert the current time instead.
|
| format(self, record)
| Format the specified record as text.
|
| The record's attribute dictionary is used as the operand to a
| string formatting operation which yields the returned string.
| Before formatting the dictionary, a couple of preparatory steps
| are carried out. The message attribute of the record is computed
| using LogRecord.getMessage(). If the formatting string uses the
| time (as determined by a call to usesTime(), formatTime() is
| called to format the event time. If there is exception information,
| it is formatted using formatException() and appended to the message.
|
| formatException(self, ei)
| Format and return the specified exception information as a string.
|
| This default implementation just uses
| traceback.print_exception()
|
| formatMessage(self, record)
|
| formatStack(self, stack_info)
| This method is provided as an extension point for specialized
| formatting of stack information.
|
| The input data is a string as returned from a call to
| :func:`traceback.print_stack`, but with the last trailing newline
| removed.
|
| The base implementation just returns the value passed in.
|
| formatTime(self, record, datefmt=None)
| Return the creation time of the specified LogRecord as formatted text.
|
| This method should be called from format() by a formatter which
| wants to make use of a formatted time. This method can be overridden
| in formatters to provide for any specific requirement, but the
| basic behaviour is as follows: if datefmt (a string) is specified,
| it is used with time.strftime() to format the creation time of the
| record. Otherwise, the ISO8601 format is used. The resulting
| string is returned. This function uses a user-configurable function
| to convert the creation time to a tuple. By default, time.localtime()
| is used; to change this for a particular formatter instance, set the
| 'converter' attribute to a function with the same signature as
| time.localtime() or time.gmtime(). To change it for all formatters,
| for example if you want all logging times to be shown in GMT,
| set the 'converter' attribute in the Formatter class.
|
| usesTime(self)
| Check if the format uses the creation time of the record.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| default_msec_format = '%s,%03d'
|
| default_time_format = '%Y-%m-%d %H:%M:%S'

class Handler(Filterer)
| Handler instances dispatch logging events to specific destinations.
|
| The base handler class. Acts as a placeholder which defines the Handler
| interface. Handlers can optionally use Formatter instances to format
| records as desired. By default, no formatter is specified; in this case,
| the 'raw' message as determined by record.message is logged.
|
| Method resolution order:
| Handler
| Filterer
| builtins.object
|
| Methods defined here:
|
| __init__(self, level=0)
| Initializes the instance - basically setting the formatter to None
| and the filter list to empty.
|
| __repr__(self)
| Return repr(self).
|
| acquire(self)
| Acquire the I/O thread lock.
|
| close(self)
| Tidy up any resources used by the handler.
|
| This version removes the handler from an internal map of handlers,
| _handlers, which is used for handler lookup by name. Subclasses
| should ensure that this gets called from overridden close()
| methods.
|
| createLock(self)
| Acquire a thread lock for serializing access to the underlying I/O.
|
| emit(self, record)
| Do whatever it takes to actually log the specified logging record.
|
| This version is intended to be implemented by subclasses and so
| raises a NotImplementedError.
|
| flush(self)
| Ensure all logging output has been flushed.
|
| This version does nothing and is intended to be implemented by
| subclasses.
|
| format(self, record)
| Format the specified record.
|
| If a formatter is set, use it. Otherwise, use the default formatter
| for the module.
|
| get_name(self)
|
| handle(self, record)
| Conditionally emit the specified logging record.
|
| Emission depends on filters which may have been added to the handler.
| Wrap the actual emission of the record with acquisition/release of
| the I/O thread lock. Returns whether the filter passed the record for
| emission.
|
| handleError(self, record)
| Handle errors which occur during an emit() call.
|
| This method should be called from handlers when an exception is
| encountered during an emit() call. If raiseExceptions is false,
| exceptions get silently ignored. This is what is mostly wanted
| for a logging system - most users will not care about errors in
| the logging system, they are more interested in application errors.
| You could, however, replace this with a custom handler if you wish.
| The record which was being processed is passed in to this method.
|
| release(self)
| Release the I/O thread lock.
|
| setFormatter(self, fmt)
| Set the formatter for this handler.
|
| setLevel(self, level)
| Set the logging level of this handler. level must be an int or a str.
|
| set_name(self, name)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| name
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this and the record is then dropped. Returns a zero value if a record
| is to be dropped, else non-zero.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class LogRecord(builtins.object)
| A LogRecord instance represents an event being logged.
|
| LogRecord instances are created every time something is logged. They
| contain all the information pertinent to the event being logged. The
| main information passed in is in msg and args, which are combined
| using str(msg) % args to create the message field of the record. The
| record also includes information such as when the record was created,
| the source line where the logging call was made, and any exception
| information to be logged.
|
| Methods defined here:
|
| __init__(self, name, level, pathname, lineno, msg, args, exc_info, func=None, sinfo=None, **kwargs)
| Initialize a logging record with interesting information.
|
| __repr__ = __str__(self)
|
| __str__(self)
| Return str(self).
|
| getMessage(self)
| Return the message for this LogRecord.
|
| Return the message for this LogRecord after merging any user-supplied
| arguments with the message.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class Logger(Filterer)
| Instances of the Logger class represent a single logging channel. A
| "logging channel" indicates an area of an application. Exactly how an
| "area" is defined is up to the application developer. Since an
| application can have any number of areas, logging channels are identified
| by a unique string. Application areas can be nested (e.g. an area
| of "input processing" might include sub-areas "read CSV files", "read
| XLS files" and "read Gnumeric files"). To cater for this natural nesting,
| channel names are organized into a namespace hierarchy where levels are
| separated by periods, much like the Java or Python package namespace. So
| in the instance given above, channel names might be "input" for the upper
| level, and "input.csv", "input.xls" and "input.gnu" for the sub-levels.
| There is no arbitrary limit to the depth of nesting.
|
| Method resolution order:
| Logger
| Filterer
| builtins.object
|
| Methods defined here:
|
| __init__(self, name, level=0)
| Initialize the logger with a name and an optional level.
|
| __repr__(self)
| Return repr(self).
|
| addHandler(self, hdlr)
| Add the specified handler to this logger.
|
| callHandlers(self, record)
| Pass a record to all relevant handlers.
|
| Loop through all handlers for this logger and its parents in the
| logger hierarchy. If no handler was found, output a one-off error
| message to sys.stderr. Stop searching up the hierarchy whenever a
| logger with the "propagate" attribute set to zero is found - that
| will be the last logger whose handlers are called.
|
| critical(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'CRITICAL'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.critical("Houston, we have a %s", "major disaster", exc_info=1)
|
| debug(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'DEBUG'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.debug("Houston, we have a %s", "thorny problem", exc_info=1)
|
| error(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'ERROR'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.error("Houston, we have a %s", "major problem", exc_info=1)
|
| exception(self, msg, *args, exc_info=True, **kwargs)
| Convenience method for logging an ERROR with exception information.
|
| fatal = critical(self, msg, *args, **kwargs)
|
| findCaller(self, stack_info=False)
| Find the stack frame of the caller so that we can note the source
| file name, line number and function name.
|
| getChild(self, suffix)
| Get a logger which is a descendant to this one.
|
| This is a convenience method, such that
|
| logging.getLogger('abc').getChild('def.ghi')
|
| is the same as
|
| logging.getLogger('abc.def.ghi')
|
| It's useful, for example, when the parent logger is named using
| __name__ rather than a literal string.
|
| getEffectiveLevel(self)
| Get the effective level for this logger.
|
| Loop through this logger and its parents in the logger hierarchy,
| looking for a non-zero logging level. Return the first one found.
|
| handle(self, record)
| Call the handlers for the specified record.
|
| This method is used for unpickled records received from a socket, as
| well as those created locally. Logger-level filtering is applied.
|
| hasHandlers(self)
| See if this logger has any handlers configured.
|
| Loop through all handlers for this logger and its parents in the
| logger hierarchy. Return True if a handler was found, else False.
| Stop searching up the hierarchy whenever a logger with the "propagate"
| attribute set to zero is found - that will be the last logger which
| is checked for the existence of handlers.
|
| info(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'INFO'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.info("Houston, we have a %s", "interesting problem", exc_info=1)
|
| isEnabledFor(self, level)
| Is this logger enabled for level 'level'?
|
| log(self, level, msg, *args, **kwargs)
| Log 'msg % args' with the integer severity 'level'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.log(level, "We have a %s", "mysterious problem", exc_info=1)
|
| makeRecord(self, name, level, fn, lno, msg, args, exc_info, func=None, extra=None, sinfo=None)
| A factory method which can be overridden in subclasses to create
| specialized LogRecords.
|
| removeHandler(self, hdlr)
| Remove the specified handler from this logger.
|
| setLevel(self, level)
| Set the logging level of this logger. level must be an int or a str.
|
| warn(self, msg, *args, **kwargs)
|
| warning(self, msg, *args, **kwargs)
| Log 'msg % args' with severity 'WARNING'.
|
| To pass exception information, use the keyword argument exc_info with
| a true value, e.g.
|
| logger.warning("Houston, we have a %s", "bit of a problem", exc_info=1)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| manager = <logging.Manager object>
|
| root = <RootLogger root (WARNING)>
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this and the record is then dropped. Returns a zero value if a record
| is to be dropped, else non-zero.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class LoggerAdapter(builtins.object)
| An adapter for loggers which makes it easier to specify contextual
| information in logging output.
|
| Methods defined here:
|
| __init__(self, logger, extra)
| Initialize the adapter with a logger and a dict-like object which
| provides contextual information. This constructor signature allows
| easy stacking of LoggerAdapters, if so desired.
|
| You can effectively pass keyword arguments as shown in the
| following example:
|
| adapter = LoggerAdapter(someLogger, dict(p1=v1, p2="v2"))
|
| __repr__(self)
| Return repr(self).
|
| critical(self, msg, *args, **kwargs)
| Delegate a critical call to the underlying logger.
|
| debug(self, msg, *args, **kwargs)
| Delegate a debug call to the underlying logger.
|
| error(self, msg, *args, **kwargs)
| Delegate an error call to the underlying logger.
|
| exception(self, msg, *args, exc_info=True, **kwargs)
| Delegate an exception call to the underlying logger.
|
| getEffectiveLevel(self)
| Get the effective level for the underlying logger.
|
| hasHandlers(self)
| See if the underlying logger has any handlers.
|
| info(self, msg, *args, **kwargs)
| Delegate an info call to the underlying logger.
|
| isEnabledFor(self, level)
| Is this logger enabled for level 'level'?
|
| log(self, level, msg, *args, **kwargs)
| Delegate a log call to the underlying logger, after adding
| contextual information from this adapter instance.
|
| process(self, msg, kwargs)
| Process the logging message and keyword arguments passed in to
| a logging call to insert contextual information. You can either
| manipulate the message itself, the keyword args or both. Return
| the message and kwargs modified (or not) to suit your needs.
|
| Normally, you'll only need to override this one method in a
| LoggerAdapter subclass for your specific needs.
|
| setLevel(self, level)
| Set the specified level on the underlying logger.
|
| warn(self, msg, *args, **kwargs)
|
| warning(self, msg, *args, **kwargs)
| Delegate a warning call to the underlying logger.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| manager
|
| name

class NullHandler(Handler)
| This handler does nothing. It's intended to be used to avoid the
| "No handlers could be found for logger XXX" one-off warning. This is
| important for library code, which may contain code to log events. If a user
| of the library does not configure logging, the one-off warning might be
| produced; to avoid this, the library developer simply needs to instantiate
| a NullHandler and add it to the top-level logger of the library module or
| package.
|
| Method resolution order:
| NullHandler
| Handler
| Filterer
| builtins.object
|
| Methods defined here:
|
| createLock(self)
| Acquire a thread lock for serializing access to the underlying I/O.
|
| emit(self, record)
| Stub.
|
| handle(self, record)
| Stub.
|
| ----------------------------------------------------------------------
| Methods inherited from Handler:
|
| __init__(self, level=0)
| Initializes the instance - basically setting the formatter to None
| and the filter list to empty.
|
| __repr__(self)
| Return repr(self).
|
| acquire(self)
| Acquire the I/O thread lock.
|
| close(self)
| Tidy up any resources used by the handler.
|
| This version removes the handler from an internal map of handlers,
| _handlers, which is used for handler lookup by name. Subclasses
| should ensure that this gets called from overridden close()
| methods.
|
| flush(self)
| Ensure all logging output has been flushed.
|
| This version does nothing and is intended to be implemented by
| subclasses.
|
| format(self, record)
| Format the specified record.
|
| If a formatter is set, use it. Otherwise, use the default formatter
| for the module.
|
| get_name(self)
|
| handleError(self, record)
| Handle errors which occur during an emit() call.
|
| This method should be called from handlers when an exception is
| encountered during an emit() call. If raiseExceptions is false,
| exceptions get silently ignored. This is what is mostly wanted
| for a logging system - most users will not care about errors in
| the logging system, they are more interested in application errors.
| You could, however, replace this with a custom handler if you wish.
| The record which was being processed is passed in to this method.
|
| release(self)
| Release the I/O thread lock.
|
| setFormatter(self, fmt)
| Set the formatter for this handler.
|
| setLevel(self, level)
| Set the logging level of this handler. level must be an int or a str.
|
| set_name(self, name)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Handler:
|
| name
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this and the record is then dropped. Returns a zero value if a record
| is to be dropped, else non-zero.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class StreamHandler(Handler)
| A handler class which writes logging records, appropriately formatted,
| to a stream. Note that this class does not close the stream, as
| sys.stdout or sys.stderr may be used.
|
| Method resolution order:
| StreamHandler
| Handler
| Filterer
| builtins.object
|
| Methods defined here:
|
| __init__(self, stream=None)
| Initialize the handler.
|
| If stream is not specified, sys.stderr is used.
|
| __repr__(self)
| Return repr(self).
|
| emit(self, record)
| Emit a record.
|
| If a formatter is specified, it is used to format the record.
| The record is then written to the stream with a trailing newline. If
| exception information is present, it is formatted using
| traceback.print_exception and appended to the stream. If the stream
| has an 'encoding' attribute, it is used to determine how to do the
| output to the stream.
|
| flush(self)
| Flushes the stream.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| terminator = '\n'
|
| ----------------------------------------------------------------------
| Methods inherited from Handler:
|
| acquire(self)
| Acquire the I/O thread lock.
|
| close(self)
| Tidy up any resources used by the handler.
|
| This version removes the handler from an internal map of handlers,
| _handlers, which is used for handler lookup by name. Subclasses
| should ensure that this gets called from overridden close()
| methods.
|
| createLock(self)
| Acquire a thread lock for serializing access to the underlying I/O.
|
| format(self, record)
| Format the specified record.
|
| If a formatter is set, use it. Otherwise, use the default formatter
| for the module.
|
| get_name(self)
|
| handle(self, record)
| Conditionally emit the specified logging record.
|
| Emission depends on filters which may have been added to the handler.
| Wrap the actual emission of the record with acquisition/release of
| the I/O thread lock. Returns whether the filter passed the record for
| emission.
|
| handleError(self, record)
| Handle errors which occur during an emit() call.
|
| This method should be called from handlers when an exception is
| encountered during an emit() call. If raiseExceptions is false,
| exceptions get silently ignored. This is what is mostly wanted
| for a logging system - most users will not care about errors in
| the logging system, they are more interested in application errors.
| You could, however, replace this with a custom handler if you wish.
| The record which was being processed is passed in to this method.
|
| release(self)
| Release the I/O thread lock.
|
| setFormatter(self, fmt)
| Set the formatter for this handler.
|
| setLevel(self, level)
| Set the logging level of this handler. level must be an int or a str.
|
| set_name(self, name)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Handler:
|
| name
|
| ----------------------------------------------------------------------
| Methods inherited from Filterer:
|
| addFilter(self, filter)
| Add the specified filter to this handler.
|
| filter(self, record)
| Determine if a record is loggable by consulting all the filters.
|
| The default is to allow the record to be logged; any filter can veto
| this and the record is then dropped. Returns a zero value if a record
| is to be dropped, else non-zero.
|
| .. versionchanged:: 3.2
|
| Allow filters to be just callables.
|
| removeFilter(self, filter)
| Remove the specified filter from this handler.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Filterer:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

FUNCTIONS
addLevelName(level, levelName)
Associate 'levelName' with 'level'.

This is used when converting levels to text during message formatting.

basicConfig(**kwargs)
Do basic configuration for the logging system.

This function does nothing if the root logger already has handlers
configured. It is a convenience method intended for use by simple scripts
to do one-shot configuration of the logging package.

The default behaviour is to create a StreamHandler which writes to
sys.stderr, set a formatter using the BASIC_FORMAT format string, and
add the handler to the root logger.

A number of optional keyword arguments may be specified, which can alter
the default behaviour.

filename Specifies that a FileHandler be created, using the specified
filename, rather than a StreamHandler.
filemode Specifies the mode to open the file, if filename is specified
(if filemode is unspecified, it defaults to 'a').
format Use the specified format string for the handler.
datefmt Use the specified date/time format.
style If a format string is specified, use this to specify the
type of format string (possible values '%', '{', '$', for
%-formatting, :meth:`str.format` and :class:`string.Template`
- defaults to '%').
level Set the root logger level to the specified level.
stream Use the specified stream to initialize the StreamHandler. Note
that this argument is incompatible with 'filename' - if both
are present, 'stream' is ignored.
handlers If specified, this should be an iterable of already created
handlers, which will be added to the root handler. Any handler
in the list which does not have a formatter assigned will be
assigned the formatter created in this function.

Note that you could specify a stream created using open(filename, mode)
rather than passing the filename and mode in. However, it should be
remembered that StreamHandler does not close its stream (since it may be
using sys.stdout or sys.stderr), whereas FileHandler closes its stream
when the handler is closed.

.. versionchanged:: 3.2
Added the ``style`` parameter.

.. versionchanged:: 3.3
Added the ``handlers`` parameter. A ``ValueError`` is now thrown for
incompatible arguments (e.g. ``handlers`` specified together with
``filename``/``filemode``, or ``filename``/``filemode`` specified
together with ``stream``, or ``handlers`` specified together with
``stream``.

captureWarnings(capture)
If capture is true, redirect all warnings to the logging package.
If capture is False, ensure that warnings are not redirected to logging
but to their original destinations.

critical(msg, *args, **kwargs)
Log a message with severity 'CRITICAL' on the root logger. If the logger
has no handlers, call basicConfig() to add a console handler with a
pre-defined format.

debug(msg, *args, **kwargs)
Log a message with severity 'DEBUG' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.

disable(level)
Disable all logging calls of severity 'level' and below.

error(msg, *args, **kwargs)
Log a message with severity 'ERROR' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.

exception(msg, *args, exc_info=True, **kwargs)
Log a message with severity 'ERROR' on the root logger, with exception
information. If the logger has no handlers, basicConfig() is called to add
a console handler with a pre-defined format.

fatal = critical(msg, *args, **kwargs)
Log a message with severity 'CRITICAL' on the root logger. If the logger
has no handlers, call basicConfig() to add a console handler with a
pre-defined format.

getLevelName(level)
Return the textual representation of logging level 'level'.

If the level is one of the predefined levels (CRITICAL, ERROR, WARNING,
INFO, DEBUG) then you get the corresponding string. If you have
associated levels with names using addLevelName then the name you have
associated with 'level' is returned.

If a numeric value corresponding to one of the defined levels is passed
in, the corresponding string representation is returned.

Otherwise, the string "Level %s" % level is returned.

getLogRecordFactory()
Return the factory to be used when instantiating a log record.

getLogger(name=None)
Return a logger with the specified name, creating it if necessary.

If no name is specified, return the root logger.

getLoggerClass()
Return the class to be used when instantiating a logger.

info(msg, *args, **kwargs)
Log a message with severity 'INFO' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.

log(level, msg, *args, **kwargs)
Log 'msg % args' with the integer severity 'level' on the root logger. If
the logger has no handlers, call basicConfig() to add a console handler
with a pre-defined format.

makeLogRecord(dict)
Make a LogRecord whose attributes are defined by the specified dictionary,
This function is useful for converting a logging event received over
a socket connection (which is sent as a dictionary) into a LogRecord
instance.

setLogRecordFactory(factory)
Set the factory to be used when instantiating a log record.

:param factory: A callable which will be called to instantiate
a log record.

setLoggerClass(klass)
Set the class to be used when instantiating a logger. The class should
define __init__() such that only a name argument is required, and the
__init__() should call Logger.__init__()

shutdown(handlerList=[<weakref at 0x0000015B97C56458; to '_StderrHandler' at 0x0000015B97C4F710>])
Perform any cleanup actions in the logging system (e.g. flushing
buffers).

Should be called at application exit.

warn(msg, *args, **kwargs)

warning(msg, *args, **kwargs)
Log a message with severity 'WARNING' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.

DATA
BASIC_FORMAT = '%(levelname)s:%(name)s:%(message)s'
CRITICAL = 50
DEBUG = 10
ERROR = 40
FATAL = 50
INFO = 20
NOTSET = 0
WARN = 30
WARNING = 30
__all__ = ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', ...
__status__ = 'production'
lastResort = <_StderrHandler <stderr> (WARNING)>
raiseExceptions = True

VERSION
0.5.1.2

DATE
07 February 2010

AUTHOR
Vinay Sajip <vinay_sajip@red-dove.com>

FILE
c:\python36\lib\logging\__init__.py

 

 

##模块使用流程
##1.先创建一个logger对象
##2.创建一个文件句柄,文件句柄控制文件输出等级和格式
##创建一个屏幕句柄,屏幕句柄控制哪个屏幕用什么格式和等级输出
##3.将lgger对象绑定屏幕和文件

 

 

 

##
##3.configparse模块#配置解析器
##用于配置文件属性
#.py文件里面的所有值,都不需要进行转换,当做变量使用.在python解释器中直接运行

#文本格式 key = value
#都要进行文件的处理
#ini
# [北京校区] # section
# 课程 = python,linux # option
# python讲师 = egon,yuanhao,nezha,boss_gold
# linux讲师 = 李导,何首乌
# [上海校区]
# 课程 = go,linux
# python讲师 = egon
# linux讲师 = 李导,何首乌

# import configparser
# config = configparser.ConfigParser()
# # config 是一个操作配置文件的对象
# config["DEFAULT"] = {'ServerAliveInterval': '45',
# 'Compression': 'yes',
# 'CompressionLevel': '9',
# 'ForwardX11':'yes'
# }
# config['bitbucket.org'] = {'User':'hg'}
# config['topsecret.server.com'] = {'Host Port':'50022',
# 'ForwardX11':'no'}
# with open('example.ini', 'w') as configfile:
# config.write(configfile)

import configparser

config = configparser.ConfigParser()
# print(config.sections()) # []
config.read('example.ini')
# print(config.sections()) # ['bitbucket.org', 'topsecret.server.com']
#
# print('bytebong.com' in config) # False
# print('bitbucket.org' in config) # True
# print(config['bitbucket.org']["user"]) # hg
# print(config['DEFAULT']['Compression']) #yes
# print(config['topsecret.server.com']['ForwardX11']) #no
#
# print(config['bitbucket.org']) #<Section: bitbucket.org>
#
# for key in config['bitbucket.org']: # 注意,有default会默认default的键
# print(key)
#
# print(config.options('bitbucket.org')) # 同for循环,找到'bitbucket.org'下所有键
# print(config.items('bitbucket.org')) #找到'bitbucket.org'下所有键值对
# print(config.get('bitbucket.org','compression')) # yes get方法Section下的key对应的value

#
# import configparser
# config = configparser.ConfigParser()
# config.read('example.ini')
# config.add_section('yuan')
# config.remove_section('bitbucket.org')
# config.remove_option('topsecret.server.com',"forwardx11")
# config.set('topsecret.server.com','k1','11111')
# config.set('yuan','k2','22222')
# config.write(open('example.ini', "w"))

 

 

 

 

 

 

 

 

 

 


#官方帮助文档解释
Help on module configparser:

NAME
configparser - Configuration file parser.

DESCRIPTION
A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.

Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.

class:

ConfigParser -- responsible for parsing a list of
configuration files, and managing the parsed database.

methods:

__init__(defaults=None, dict_type=_default_dict, allow_no_value=False,
delimiters=('=', ':'), comment_prefixes=('#', ';'),
inline_comment_prefixes=None, strict=True,
empty_lines_in_values=True, default_section='DEFAULT',
interpolation=<unset>, converters=<unset>):
Create the parser. When `defaults' is given, it is initialized into the
dictionary or intrinsic defaults. The keys must be strings, the values
must be appropriate for %()s string interpolation.

When `dict_type' is given, it will be used to create the dictionary
objects for the list of sections, for the options within a section, and
for the default values.

When `delimiters' is given, it will be used as the set of substrings
that divide keys from values.

When `comment_prefixes' is given, it will be used as the set of
substrings that prefix comments in empty lines. Comments can be
indented.

When `inline_comment_prefixes' is given, it will be used as the set of
substrings that prefix comments in non-empty lines.

When `strict` is True, the parser won't allow for any section or option
duplicates while reading from a single source (file, string or
dictionary). Default is True.

When `empty_lines_in_values' is False (default: True), each empty line
marks the end of an option. Otherwise, internal empty lines of
a multiline option are kept as part of the value.

When `allow_no_value' is True (default: False), options without
values are accepted; the value presented for these is None.

When `default_section' is given, the name of the special section is
named accordingly. By default it is called ``"DEFAULT"`` but this can
be customized to point to any other valid section name. Its current
value can be retrieved using the ``parser_instance.default_section``
attribute and may be modified at runtime.

When `interpolation` is given, it should be an Interpolation subclass
instance. It will be used as the handler for option value
pre-processing when using getters. RawConfigParser object s don't do
any sort of interpolation, whereas ConfigParser uses an instance of
BasicInterpolation. The library also provides a ``zc.buildbot``
inspired ExtendedInterpolation implementation.

When `converters` is given, it should be a dictionary where each key
represents the name of a type converter and each value is a callable
implementing the conversion from string to the desired datatype. Every
converter gets its corresponding get*() method on the parser object and
section proxies.

sections()
Return all the configuration section names, sans DEFAULT.

has_section(section)
Return whether the given section exists.

has_option(section, option)
Return whether the given option exists in the given section.

options(section)
Return list of configuration options for the named section.

read(filenames, encoding=None)
Read and parse the list of named configuration files, given by
name. A single filename is also allowed. Non-existing files
are ignored. Return list of successfully read files.

read_file(f, filename=None)
Read and parse one configuration file, given as a file object.
The filename defaults to f.name; it is only used in error
messages (if f has no `name' attribute, the string `<???>' is used).

read_string(string)
Read configuration from a given string.

read_dict(dictionary)
Read configuration from a dictionary. Keys are section names,
values are dictionaries with keys and values that should be present
in the section. If the used dictionary type preserves order, sections
and their keys will be added in order. Values are automatically
converted to strings.

get(section, option, raw=False, vars=None, fallback=_UNSET)
Return a string value for the named option. All % interpolations are
expanded in the return values, based on the defaults passed into the
constructor and the DEFAULT section. Additional substitutions may be
provided using the `vars' argument, which must be a dictionary whose
contents override any pre-existing defaults. If `option' is a key in
`vars', the value from `vars' is used.

getint(section, options, raw=False, vars=None, fallback=_UNSET)
Like get(), but convert value to an integer.

getfloat(section, options, raw=False, vars=None, fallback=_UNSET)
Like get(), but convert value to a float.

getboolean(section, options, raw=False, vars=None, fallback=_UNSET)
Like get(), but convert value to a boolean (currently case
insensitively defined as 0, false, no, off for False, and 1, true,
yes, on for True). Returns False or True.

items(section=_UNSET, raw=False, vars=None)
If section is given, return a list of tuples with (name, value) for
each option in the section. Otherwise, return a list of tuples with
(section_name, section_proxy) for each section, including DEFAULTSECT.

remove_section(section)
Remove the given file section and all its options.

remove_option(section, option)
Remove the given option from the given section.

set(section, option, value)
Set the given option.

write(fp, space_around_delimiters=True)
Write the configuration state in .ini format. If
`space_around_delimiters' is True (the default), delimiters
between keys and values are surrounded by spaces.

CLASSES
builtins.object
Interpolation
BasicInterpolation
ExtendedInterpolation
LegacyInterpolation
collections.abc.MutableMapping(collections.abc.Mapping)
ConverterMapping
RawConfigParser
ConfigParser
SafeConfigParser
SectionProxy
Error(builtins.Exception)
DuplicateOptionError
DuplicateSectionError
InterpolationError
InterpolationDepthError
InterpolationMissingOptionError
InterpolationSyntaxError
NoOptionError
NoSectionError
ParsingError
MissingSectionHeaderError

class BasicInterpolation(Interpolation)
| Interpolation as implemented in the classic ConfigParser.
|
| The option values can contain format strings which refer to other values in
| the same section, or values in the special default section.
|
| For example:
|
| something: %(dir)s/whatever
|
| would resolve the "%(dir)s" to the value of dir. All reference
| expansions are done late, on demand. If a user needs to use a bare % in
| a configuration file, she can escape it by writing %%. Other % usage
| is considered a user error and raises `InterpolationSyntaxError'.
|
| Method resolution order:
| BasicInterpolation
| Interpolation
| builtins.object
|
| Methods defined here:
|
| before_get(self, parser, section, option, value, defaults)
|
| before_set(self, parser, section, option, value)
|
| ----------------------------------------------------------------------
| Methods inherited from Interpolation:
|
| before_read(self, parser, section, option, value)
|
| before_write(self, parser, section, option, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Interpolation:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class ConfigParser(RawConfigParser)
| ConfigParser implementing interpolation.
|
| Method resolution order:
| ConfigParser
| RawConfigParser
| collections.abc.MutableMapping
| collections.abc.Mapping
| collections.abc.Collection
| collections.abc.Sized
| collections.abc.Iterable
| collections.abc.Container
| builtins.object
|
| Methods defined here:
|
| add_section(self, section)
| Create a new section in the configuration. Extends
| RawConfigParser.add_section by validating if the section name is
| a string.
|
| set(self, section, option, value=None)
| Set an option. Extends RawConfigParser.set by validating type and
| interpolation syntax on the value.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __abstractmethods__ = frozenset()
|
| ----------------------------------------------------------------------
| Methods inherited from RawConfigParser:
|
| __contains__(self, key)
|
| __delitem__(self, key)
|
| __getitem__(self, key)
|
| __init__(self, defaults=None, dict_type=<class 'collections.OrderedDict'>, allow_no_value=False, *, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section='DEFAULT', interpolation=<object object at 0x0000017B135FB1A0>, converters=<object object at 0x0000017B135FB1A0>)
| Initialize self. See help(type(self)) for accurate signature.
|
| __iter__(self)
|
| __len__(self)
|
| __setitem__(self, key, value)
|
| defaults(self)
|
| get(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>)
| Get an option value for a given section.
|
| If `vars' is provided, it must be a dictionary. The option is looked up
| in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
| If the key is not found and `fallback' is provided, it is used as
| a fallback value. `None' can be provided as a `fallback' value.
|
| If interpolation is enabled and the optional argument `raw' is False,
| all interpolations are expanded in the return values.
|
| Arguments `raw', `vars', and `fallback' are keyword only.
|
| The section DEFAULT is special.
|
| getboolean(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>, **kwargs)
|
| getfloat(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>, **kwargs)
|
| getint(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>, **kwargs)
| # getint, getfloat and getboolean provided directly for backwards compat
|
| has_option(self, section, option)
| Check for the existence of a given option in a given section.
| If the specified `section' is None or an empty string, DEFAULT is
| assumed. If the specified `section' does not exist, returns False.
|
| has_section(self, section)
| Indicate whether the named section is present in the configuration.
|
| The DEFAULT section is not acknowledged.
|
| items(self, section=<object object at 0x0000017B135FB1A0>, raw=False, vars=None)
| Return a list of (name, value) tuples for each option in a section.
|
| All % interpolations are expanded in the return values, based on the
| defaults passed into the constructor, unless the optional argument
| `raw' is true. Additional substitutions may be provided using the
| `vars' argument, which must be a dictionary whose contents overrides
| any pre-existing defaults.
|
| The section DEFAULT is special.
|
| options(self, section)
| Return a list of option names for the given section name.
|
| optionxform(self, optionstr)
|
| popitem(self)
| Remove a section from the parser and return it as
| a (section_name, section_proxy) tuple. If no section is present, raise
| KeyError.
|
| The section DEFAULT is never returned because it cannot be removed.
|
| read(self, filenames, encoding=None)
| Read and parse a filename or a list of filenames.
|
| Files that cannot be opened are silently ignored; this is
| designed so that you can specify a list of potential
| configuration file locations (e.g. current directory, user's
| home directory, systemwide directory), and all existing
| configuration files in the list will be read. A single
| filename may also be given.
|
| Return list of successfully read files.
|
| read_dict(self, dictionary, source='<dict>')
| Read configuration from a dictionary.
|
| Keys are section names, values are dictionaries with keys and values
| that should be present in the section. If the used dictionary type
| preserves order, sections and their keys will be added in order.
|
| All types held in the dictionary are converted to strings during
| reading, including section names, option names and keys.
|
| Optional second argument is the `source' specifying the name of the
| dictionary being read.
|
| read_file(self, f, source=None)
| Like read() but the argument must be a file-like object.
|
| The `f' argument must be iterable, returning one line at a time.
| Optional second argument is the `source' specifying the name of the
| file being read. If not given, it is taken from f.name. If `f' has no
| `name' attribute, `<???>' is used.
|
| read_string(self, string, source='<string>')
| Read configuration from a given string.
|
| readfp(self, fp, filename=None)
| Deprecated, use read_file instead.
|
| remove_option(self, section, option)
| Remove an option.
|
| remove_section(self, section)
| Remove a file section.
|
| sections(self)
| Return a list of section names, excluding [DEFAULT]
|
| write(self, fp, space_around_delimiters=True)
| Write an .ini-format representation of the configuration state.
|
| If `space_around_delimiters' is True (the default), delimiters
| between keys and values are surrounded by spaces.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from RawConfigParser:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| converters
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from RawConfigParser:
|
| BOOLEAN_STATES = {'0': False, '1': True, 'false': False, 'no': False, ...
|
| NONSPACECRE = re.compile('\\S')
|
| OPTCRE = re.compile('\n (?P<option>.*?) ... ...
|
| OPTCRE_NV = re.compile('\n (?P<option>.*?) ... ...
|
| SECTCRE = re.compile('\n \\[ ... ...
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.MutableMapping:
|
| clear(self)
| D.clear() -> None. Remove all items from D.
|
| pop(self, key, default=<object object at 0x0000017B135FB050>)
| D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
| If key is not found, d is returned if given, otherwise KeyError is raised.
|
| setdefault(self, key, default=None)
| D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
|
| update(*args, **kwds)
| D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.
| If E present and has a .keys() method, does: for k in E: D[k] = E[k]
| If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
| In either case, this is followed by: for k, v in F.items(): D[k] = v
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.Mapping:
|
| __eq__(self, other)
| Return self==value.
|
| keys(self)
| D.keys() -> a set-like object providing a view on D's keys
|
| values(self)
| D.values() -> an object providing a view on D's values
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from collections.abc.Mapping:
|
| __hash__ = None
|
| __reversed__ = None
|
| ----------------------------------------------------------------------
| Class methods inherited from collections.abc.Collection:
|
| __subclasshook__(C) from abc.ABCMeta
| Abstract classes can override this to customize issubclass().
|
| This is invoked early on by abc.ABCMeta.__subclasscheck__().
| It should return True, False or NotImplemented. If it returns
| NotImplemented, the normal algorithm is used. Otherwise, it
| overrides the normal algorithm (and the outcome is cached).

class ConverterMapping(collections.abc.MutableMapping)
| Enables reuse of get*() methods between the parser and section proxies.
|
| If a parser class implements a getter directly, the value for the given
| key will be ``None``. The presence of the converter name here enables
| section proxies to find and use the implementation on the parser class.
|
| Method resolution order:
| ConverterMapping
| collections.abc.MutableMapping
| collections.abc.Mapping
| collections.abc.Collection
| collections.abc.Sized
| collections.abc.Iterable
| collections.abc.Container
| builtins.object
|
| Methods defined here:
|
| __delitem__(self, key)
|
| __getitem__(self, key)
|
| __init__(self, parser)
| Initialize self. See help(type(self)) for accurate signature.
|
| __iter__(self)
|
| __len__(self)
|
| __setitem__(self, key, value)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| GETTERCRE = re.compile('^get(?P<name>.+)$')
|
| __abstractmethods__ = frozenset()
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.MutableMapping:
|
| clear(self)
| D.clear() -> None. Remove all items from D.
|
| pop(self, key, default=<object object at 0x0000017B135FB050>)
| D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
| If key is not found, d is returned if given, otherwise KeyError is raised.
|
| popitem(self)
| D.popitem() -> (k, v), remove and return some (key, value) pair
| as a 2-tuple; but raise KeyError if D is empty.
|
| setdefault(self, key, default=None)
| D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
|
| update(*args, **kwds)
| D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.
| If E present and has a .keys() method, does: for k in E: D[k] = E[k]
| If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
| In either case, this is followed by: for k, v in F.items(): D[k] = v
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.Mapping:
|
| __contains__(self, key)
|
| __eq__(self, other)
| Return self==value.
|
| get(self, key, default=None)
| D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
|
| items(self)
| D.items() -> a set-like object providing a view on D's items
|
| keys(self)
| D.keys() -> a set-like object providing a view on D's keys
|
| values(self)
| D.values() -> an object providing a view on D's values
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from collections.abc.Mapping:
|
| __hash__ = None
|
| __reversed__ = None
|
| ----------------------------------------------------------------------
| Class methods inherited from collections.abc.Collection:
|
| __subclasshook__(C) from abc.ABCMeta
| Abstract classes can override this to customize issubclass().
|
| This is invoked early on by abc.ABCMeta.__subclasscheck__().
| It should return True, False or NotImplemented. If it returns
| NotImplemented, the normal algorithm is used. Otherwise, it
| overrides the normal algorithm (and the outcome is cached).

class DuplicateOptionError(Error)
| Raised by strict parsers when an option is repeated in an input source.
|
| Current implementation raises this exception only when an option is found
| more than once in a single file, string or dictionary.
|
| Method resolution order:
| DuplicateOptionError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, section, option, source=None, lineno=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class DuplicateSectionError(Error)
| Raised when a section is repeated in an input source.
|
| Possible repetitions that raise this exception are: multiple creation
| using the API or in strict parsers when a section is found more than once
| in a single input file, string or dictionary.
|
| Method resolution order:
| DuplicateSectionError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, section, source=None, lineno=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class ExtendedInterpolation(Interpolation)
| Advanced variant of interpolation, supports the syntax used by
| `zc.buildout'. Enables interpolation between sections.
|
| Method resolution order:
| ExtendedInterpolation
| Interpolation
| builtins.object
|
| Methods defined here:
|
| before_get(self, parser, section, option, value, defaults)
|
| before_set(self, parser, section, option, value)
|
| ----------------------------------------------------------------------
| Methods inherited from Interpolation:
|
| before_read(self, parser, section, option, value)
|
| before_write(self, parser, section, option, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Interpolation:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class Interpolation(builtins.object)
| Dummy interpolation that passes the value through with no changes.
|
| Methods defined here:
|
| before_get(self, parser, section, option, value, defaults)
|
| before_read(self, parser, section, option, value)
|
| before_set(self, parser, section, option, value)
|
| before_write(self, parser, section, option, value)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class InterpolationDepthError(InterpolationError)
| Raised when substitutions are nested too deeply.
|
| Method resolution order:
| InterpolationDepthError
| InterpolationError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, option, section, rawval)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class InterpolationError(Error)
| Base class for interpolation-related exceptions.
|
| Method resolution order:
| InterpolationError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, option, section, msg)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class InterpolationMissingOptionError(InterpolationError)
| A string substitution required a setting which was not available.
|
| Method resolution order:
| InterpolationMissingOptionError
| InterpolationError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, option, section, rawval, reference)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class InterpolationSyntaxError(InterpolationError)
| Raised when the source text contains invalid syntax.
|
| Current implementation raises this exception when the source text into
| which substitutions are made does not conform to the required syntax.
|
| Method resolution order:
| InterpolationSyntaxError
| InterpolationError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods inherited from InterpolationError:
|
| __init__(self, option, section, msg)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class LegacyInterpolation(Interpolation)
| Deprecated interpolation used in old versions of ConfigParser.
| Use BasicInterpolation or ExtendedInterpolation instead.
|
| Method resolution order:
| LegacyInterpolation
| Interpolation
| builtins.object
|
| Methods defined here:
|
| before_get(self, parser, section, option, value, vars)
|
| before_set(self, parser, section, option, value)
|
| ----------------------------------------------------------------------
| Methods inherited from Interpolation:
|
| before_read(self, parser, section, option, value)
|
| before_write(self, parser, section, option, value)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Interpolation:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)

class MissingSectionHeaderError(ParsingError)
| Raised when a key-value pair is found before any section header.
|
| Method resolution order:
| MissingSectionHeaderError
| ParsingError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, filename, lineno, line)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from ParsingError:
|
| append(self, lineno, line)
|
| ----------------------------------------------------------------------
| Data descriptors inherited from ParsingError:
|
| filename
| Deprecated, use `source'.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class NoOptionError(Error)
| A requested option was not found.
|
| Method resolution order:
| NoOptionError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, option, section)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class NoSectionError(Error)
| Raised when no section matches a requested option.
|
| Method resolution order:
| NoSectionError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, section)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class ParsingError(Error)
| Raised when a configuration file does not follow legal syntax.
|
| Method resolution order:
| ParsingError
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, source=None, filename=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| append(self, lineno, line)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| filename
| Deprecated, use `source'.
|
| ----------------------------------------------------------------------
| Methods inherited from Error:
|
| __repr__(self)
| Return repr(self).
|
| __str__ = __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors inherited from Error:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args

class RawConfigParser(collections.abc.MutableMapping)
| ConfigParser that does not do interpolation.
|
| Method resolution order:
| RawConfigParser
| collections.abc.MutableMapping
| collections.abc.Mapping
| collections.abc.Collection
| collections.abc.Sized
| collections.abc.Iterable
| collections.abc.Container
| builtins.object
|
| Methods defined here:
|
| __contains__(self, key)
|
| __delitem__(self, key)
|
| __getitem__(self, key)
|
| __init__(self, defaults=None, dict_type=<class 'collections.OrderedDict'>, allow_no_value=False, *, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section='DEFAULT', interpolation=<object object at 0x0000017B135FB1A0>, converters=<object object at 0x0000017B135FB1A0>)
| Initialize self. See help(type(self)) for accurate signature.
|
| __iter__(self)
|
| __len__(self)
|
| __setitem__(self, key, value)
|
| add_section(self, section)
| Create a new section in the configuration.
|
| Raise DuplicateSectionError if a section by the specified name
| already exists. Raise ValueError if name is DEFAULT.
|
| defaults(self)
|
| get(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>)
| Get an option value for a given section.
|
| If `vars' is provided, it must be a dictionary. The option is looked up
| in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
| If the key is not found and `fallback' is provided, it is used as
| a fallback value. `None' can be provided as a `fallback' value.
|
| If interpolation is enabled and the optional argument `raw' is False,
| all interpolations are expanded in the return values.
|
| Arguments `raw', `vars', and `fallback' are keyword only.
|
| The section DEFAULT is special.
|
| getboolean(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>, **kwargs)
|
| getfloat(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>, **kwargs)
|
| getint(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>, **kwargs)
| # getint, getfloat and getboolean provided directly for backwards compat
|
| has_option(self, section, option)
| Check for the existence of a given option in a given section.
| If the specified `section' is None or an empty string, DEFAULT is
| assumed. If the specified `section' does not exist, returns False.
|
| has_section(self, section)
| Indicate whether the named section is present in the configuration.
|
| The DEFAULT section is not acknowledged.
|
| items(self, section=<object object at 0x0000017B135FB1A0>, raw=False, vars=None)
| Return a list of (name, value) tuples for each option in a section.
|
| All % interpolations are expanded in the return values, based on the
| defaults passed into the constructor, unless the optional argument
| `raw' is true. Additional substitutions may be provided using the
| `vars' argument, which must be a dictionary whose contents overrides
| any pre-existing defaults.
|
| The section DEFAULT is special.
|
| options(self, section)
| Return a list of option names for the given section name.
|
| optionxform(self, optionstr)
|
| popitem(self)
| Remove a section from the parser and return it as
| a (section_name, section_proxy) tuple. If no section is present, raise
| KeyError.
|
| The section DEFAULT is never returned because it cannot be removed.
|
| read(self, filenames, encoding=None)
| Read and parse a filename or a list of filenames.
|
| Files that cannot be opened are silently ignored; this is
| designed so that you can specify a list of potential
| configuration file locations (e.g. current directory, user's
| home directory, systemwide directory), and all existing
| configuration files in the list will be read. A single
| filename may also be given.
|
| Return list of successfully read files.
|
| read_dict(self, dictionary, source='<dict>')
| Read configuration from a dictionary.
|
| Keys are section names, values are dictionaries with keys and values
| that should be present in the section. If the used dictionary type
| preserves order, sections and their keys will be added in order.
|
| All types held in the dictionary are converted to strings during
| reading, including section names, option names and keys.
|
| Optional second argument is the `source' specifying the name of the
| dictionary being read.
|
| read_file(self, f, source=None)
| Like read() but the argument must be a file-like object.
|
| The `f' argument must be iterable, returning one line at a time.
| Optional second argument is the `source' specifying the name of the
| file being read. If not given, it is taken from f.name. If `f' has no
| `name' attribute, `<???>' is used.
|
| read_string(self, string, source='<string>')
| Read configuration from a given string.
|
| readfp(self, fp, filename=None)
| Deprecated, use read_file instead.
|
| remove_option(self, section, option)
| Remove an option.
|
| remove_section(self, section)
| Remove a file section.
|
| sections(self)
| Return a list of section names, excluding [DEFAULT]
|
| set(self, section, option, value=None)
| Set an option.
|
| write(self, fp, space_around_delimiters=True)
| Write an .ini-format representation of the configuration state.
|
| If `space_around_delimiters' is True (the default), delimiters
| between keys and values are surrounded by spaces.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| converters
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| BOOLEAN_STATES = {'0': False, '1': True, 'false': False, 'no': False, ...
|
| NONSPACECRE = re.compile('\\S')
|
| OPTCRE = re.compile('\n (?P<option>.*?) ... ...
|
| OPTCRE_NV = re.compile('\n (?P<option>.*?) ... ...
|
| SECTCRE = re.compile('\n \\[ ... ...
|
| __abstractmethods__ = frozenset()
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.MutableMapping:
|
| clear(self)
| D.clear() -> None. Remove all items from D.
|
| pop(self, key, default=<object object at 0x0000017B135FB050>)
| D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
| If key is not found, d is returned if given, otherwise KeyError is raised.
|
| setdefault(self, key, default=None)
| D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
|
| update(*args, **kwds)
| D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.
| If E present and has a .keys() method, does: for k in E: D[k] = E[k]
| If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
| In either case, this is followed by: for k, v in F.items(): D[k] = v
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.Mapping:
|
| __eq__(self, other)
| Return self==value.
|
| keys(self)
| D.keys() -> a set-like object providing a view on D's keys
|
| values(self)
| D.values() -> an object providing a view on D's values
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from collections.abc.Mapping:
|
| __hash__ = None
|
| __reversed__ = None
|
| ----------------------------------------------------------------------
| Class methods inherited from collections.abc.Collection:
|
| __subclasshook__(C) from abc.ABCMeta
| Abstract classes can override this to customize issubclass().
|
| This is invoked early on by abc.ABCMeta.__subclasscheck__().
| It should return True, False or NotImplemented. If it returns
| NotImplemented, the normal algorithm is used. Otherwise, it
| overrides the normal algorithm (and the outcome is cached).

class SafeConfigParser(ConfigParser)
| ConfigParser alias for backwards compatibility purposes.
|
| Method resolution order:
| SafeConfigParser
| ConfigParser
| RawConfigParser
| collections.abc.MutableMapping
| collections.abc.Mapping
| collections.abc.Collection
| collections.abc.Sized
| collections.abc.Iterable
| collections.abc.Container
| builtins.object
|
| Methods defined here:
|
| __init__(self, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __abstractmethods__ = frozenset()
|
| ----------------------------------------------------------------------
| Methods inherited from ConfigParser:
|
| add_section(self, section)
| Create a new section in the configuration. Extends
| RawConfigParser.add_section by validating if the section name is
| a string.
|
| set(self, section, option, value=None)
| Set an option. Extends RawConfigParser.set by validating type and
| interpolation syntax on the value.
|
| ----------------------------------------------------------------------
| Methods inherited from RawConfigParser:
|
| __contains__(self, key)
|
| __delitem__(self, key)
|
| __getitem__(self, key)
|
| __iter__(self)
|
| __len__(self)
|
| __setitem__(self, key, value)
|
| defaults(self)
|
| get(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>)
| Get an option value for a given section.
|
| If `vars' is provided, it must be a dictionary. The option is looked up
| in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
| If the key is not found and `fallback' is provided, it is used as
| a fallback value. `None' can be provided as a `fallback' value.
|
| If interpolation is enabled and the optional argument `raw' is False,
| all interpolations are expanded in the return values.
|
| Arguments `raw', `vars', and `fallback' are keyword only.
|
| The section DEFAULT is special.
|
| getboolean(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>, **kwargs)
|
| getfloat(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>, **kwargs)
|
| getint(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x0000017B135FB1A0>, **kwargs)
| # getint, getfloat and getboolean provided directly for backwards compat
|
| has_option(self, section, option)
| Check for the existence of a given option in a given section.
| If the specified `section' is None or an empty string, DEFAULT is
| assumed. If the specified `section' does not exist, returns False.
|
| has_section(self, section)
| Indicate whether the named section is present in the configuration.
|
| The DEFAULT section is not acknowledged.
|
| items(self, section=<object object at 0x0000017B135FB1A0>, raw=False, vars=None)
| Return a list of (name, value) tuples for each option in a section.
|
| All % interpolations are expanded in the return values, based on the
| defaults passed into the constructor, unless the optional argument
| `raw' is true. Additional substitutions may be provided using the
| `vars' argument, which must be a dictionary whose contents overrides
| any pre-existing defaults.
|
| The section DEFAULT is special.
|
| options(self, section)
| Return a list of option names for the given section name.
|
| optionxform(self, optionstr)
|
| popitem(self)
| Remove a section from the parser and return it as
| a (section_name, section_proxy) tuple. If no section is present, raise
| KeyError.
|
| The section DEFAULT is never returned because it cannot be removed.
|
| read(self, filenames, encoding=None)
| Read and parse a filename or a list of filenames.
|
| Files that cannot be opened are silently ignored; this is
| designed so that you can specify a list of potential
| configuration file locations (e.g. current directory, user's
| home directory, systemwide directory), and all existing
| configuration files in the list will be read. A single
| filename may also be given.
|
| Return list of successfully read files.
|
| read_dict(self, dictionary, source='<dict>')
| Read configuration from a dictionary.
|
| Keys are section names, values are dictionaries with keys and values
| that should be present in the section. If the used dictionary type
| preserves order, sections and their keys will be added in order.
|
| All types held in the dictionary are converted to strings during
| reading, including section names, option names and keys.
|
| Optional second argument is the `source' specifying the name of the
| dictionary being read.
|
| read_file(self, f, source=None)
| Like read() but the argument must be a file-like object.
|
| The `f' argument must be iterable, returning one line at a time.
| Optional second argument is the `source' specifying the name of the
| file being read. If not given, it is taken from f.name. If `f' has no
| `name' attribute, `<???>' is used.
|
| read_string(self, string, source='<string>')
| Read configuration from a given string.
|
| readfp(self, fp, filename=None)
| Deprecated, use read_file instead.
|
| remove_option(self, section, option)
| Remove an option.
|
| remove_section(self, section)
| Remove a file section.
|
| sections(self)
| Return a list of section names, excluding [DEFAULT]
|
| write(self, fp, space_around_delimiters=True)
| Write an .ini-format representation of the configuration state.
|
| If `space_around_delimiters' is True (the default), delimiters
| between keys and values are surrounded by spaces.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from RawConfigParser:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| converters
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from RawConfigParser:
|
| BOOLEAN_STATES = {'0': False, '1': True, 'false': False, 'no': False, ...
|
| NONSPACECRE = re.compile('\\S')
|
| OPTCRE = re.compile('\n (?P<option>.*?) ... ...
|
| OPTCRE_NV = re.compile('\n (?P<option>.*?) ... ...
|
| SECTCRE = re.compile('\n \\[ ... ...
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.MutableMapping:
|
| clear(self)
| D.clear() -> None. Remove all items from D.
|
| pop(self, key, default=<object object at 0x0000017B135FB050>)
| D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
| If key is not found, d is returned if given, otherwise KeyError is raised.
|
| setdefault(self, key, default=None)
| D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
|
| update(*args, **kwds)
| D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.
| If E present and has a .keys() method, does: for k in E: D[k] = E[k]
| If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
| In either case, this is followed by: for k, v in F.items(): D[k] = v
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.Mapping:
|
| __eq__(self, other)
| Return self==value.
|
| keys(self)
| D.keys() -> a set-like object providing a view on D's keys
|
| values(self)
| D.values() -> an object providing a view on D's values
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from collections.abc.Mapping:
|
| __hash__ = None
|
| __reversed__ = None
|
| ----------------------------------------------------------------------
| Class methods inherited from collections.abc.Collection:
|
| __subclasshook__(C) from abc.ABCMeta
| Abstract classes can override this to customize issubclass().
|
| This is invoked early on by abc.ABCMeta.__subclasscheck__().
| It should return True, False or NotImplemented. If it returns
| NotImplemented, the normal algorithm is used. Otherwise, it
| overrides the normal algorithm (and the outcome is cached).

class SectionProxy(collections.abc.MutableMapping)
| A proxy for a single section from a parser.
|
| Method resolution order:
| SectionProxy
| collections.abc.MutableMapping
| collections.abc.Mapping
| collections.abc.Collection
| collections.abc.Sized
| collections.abc.Iterable
| collections.abc.Container
| builtins.object
|
| Methods defined here:
|
| __contains__(self, key)
|
| __delitem__(self, key)
|
| __getitem__(self, key)
|
| __init__(self, parser, name)
| Creates a view on a section of the specified `name` in `parser`.
|
| __iter__(self)
|
| __len__(self)
|
| __repr__(self)
| Return repr(self).
|
| __setitem__(self, key, value)
|
| get(self, option, fallback=None, *, raw=False, vars=None, _impl=None, **kwargs)
| Get an option value.
|
| Unless `fallback` is provided, `None` will be returned if the option
| is not found.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)
|
| name
|
| parser
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __abstractmethods__ = frozenset()
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.MutableMapping:
|
| clear(self)
| D.clear() -> None. Remove all items from D.
|
| pop(self, key, default=<object object at 0x0000017B135FB050>)
| D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
| If key is not found, d is returned if given, otherwise KeyError is raised.
|
| popitem(self)
| D.popitem() -> (k, v), remove and return some (key, value) pair
| as a 2-tuple; but raise KeyError if D is empty.
|
| setdefault(self, key, default=None)
| D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
|
| update(*args, **kwds)
| D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.
| If E present and has a .keys() method, does: for k in E: D[k] = E[k]
| If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
| In either case, this is followed by: for k, v in F.items(): D[k] = v
|
| ----------------------------------------------------------------------
| Methods inherited from collections.abc.Mapping:
|
| __eq__(self, other)
| Return self==value.
|
| items(self)
| D.items() -> a set-like object providing a view on D's items
|
| keys(self)
| D.keys() -> a set-like object providing a view on D's keys
|
| values(self)
| D.values() -> an object providing a view on D's values
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from collections.abc.Mapping:
|
| __hash__ = None
|
| __reversed__ = None
|
| ----------------------------------------------------------------------
| Class methods inherited from collections.abc.Collection:
|
| __subclasshook__(C) from abc.ABCMeta
| Abstract classes can override this to customize issubclass().
|
| This is invoked early on by abc.ABCMeta.__subclasscheck__().
| It should return True, False or NotImplemented. If it returns
| NotImplemented, the normal algorithm is used. Otherwise, it
| overrides the normal algorithm (and the outcome is cached).

DATA
DEFAULTSECT = 'DEFAULT'
MAX_INTERPOLATION_DEPTH = 10
__all__ = ['NoSectionError', 'DuplicateOptionError', 'DuplicateSection...

FILE
c:\python36\lib\configparser.py

 

转载于:https://www.cnblogs.com/cangshuchirou/p/8570064.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值