Repository URL to install this package:
Version:
1.0.8-1 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
coverage
/
__pycache__
/
tomlconfig.cpython-37.pyc
|
---|
B Ïo"Ëã @ s d Z ddlZddlZddlZddlmZ ddlmZmZ ddl m Z mZ yddlZW n e k rl dZY nX G dd deZG dd d ZdS ) z*TOML configuration support for coverage.pyé N)Úenv)ÚconfigparserÚ path_types)ÚCoverageExceptionÚsubstitute_variablesc @ s e Zd ZdZdS )ÚTomlDecodeErrorz>An exception class that exists even when toml isn't installed.N)Ú__name__Ú __module__Ú__qualname__Ú__doc__© r r ú/build/wlanpi-profiler-MIf3Xw/wlanpi-profiler-1.0.8/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/tomlconfig.pyr s r c @ s e Zd ZdZdd Zdd Zdd Zdd Zd d Zdd Z dd Z dd Zdd Zdd Z dd Zdd Zdd Zdd Zdd Zd S )!ÚTomlConfigParserz:TOML file reading with the interface of HandyConfigParser.c C s || _ d | _d S )N)Úour_fileÚdata)Úselfr r r r Ú__init__! s zTomlConfigParser.__init__c C sî t |tst|}tjdkr&t |¡}y&tj|dd}| ¡ }W d Q R X W n t k r` g S X tr¸t|tj }yt |¡| _W n. tjk r° } zt|j W d d }~X Y nX |gS tjd|tjd}| jsÔ|ræd}t| |¡g S d S )N)é é zutf-8)Úencodingz^\[tool\.coverage\.)Úflagsz?Can't read {!r} without TOML support. Install with [toml] extra)Ú isinstancer ÚAssertionErrorr Z PYVERSIONÚosÚfspathÚioÚopenÚreadÚIOErrorÚtomlr ÚenvironÚloadsr r ÚargsÚreÚsearchÚ MULTILINEr r Úformat)r Ú filenamesÚfilenameÚfpZ toml_textÚerrZhas_tomlÚmsgr r r r % s* zTomlConfigParser.readc C s dg}| j r| d¡ xl|D ]`}|| }| d¡}y0| j|d }x|dd D ]}|| }qPW W n tk rx wY nX P qW dS ||fS )aC Get a section from the data. Arguments: section (str): A section name, which can be dotted. Returns: name (str): the actual name of the section that was found, if any, or None. data (str): the dict of data in the section, or None if not found. ztool.coverage.Ú Ú.r é N)NN)r ÚappendÚsplitr ÚKeyError)r ÚsectionÚprefixesÚprefixZreal_sectionÚpartsr Úpartr r r Ú_get_sectionA s zTomlConfigParser._get_sectionc C sR | |¡\}}|dkr t |¡y||| fS tk rL t ||¡Y nX dS )z;Like .get, but returns the real section name and the value.N)r7 r ÚNoSectionErrorr1 Ú NoOptionError)r r2 ÚoptionÚnamer r r r Ú_get^ s zTomlConfigParser._getc C s" | |¡\}}|d krdS ||kS )NF)r7 )r r2 r: Ú_r r r r Ú has_optionh s zTomlConfigParser.has_optionc C s | |¡\}}|S )N)r7 )r r2 r; r= r r r Úhas_sectionn s zTomlConfigParser.has_sectionc C s, | |¡\}}|d kr t |¡t| ¡ S )N)r7 r r8 ÚlistÚkeys)r r2 r= r r r r Úoptionsr s zTomlConfigParser.optionsc C s | |¡\}}|S )N)r7 )r r2 r= r r r r Úget_sectionx s zTomlConfigParser.get_sectionc C s | ||¡\}}|S )N)r<