Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
B

ô‡¨öþ:B*ã@sôdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZmZddlmZmZddlmZddlmZddlmZeeƒZejjZGd	d
„d
ƒZdd„ZGd
d„dƒZdd„Z dd„Z!dd„Z"dd„Z#dS)zExecute files of Python code.éN)Úenv)ÚCoverageExceptionÚ_ExceptionDuringRunÚNoCodeÚNoSource)Úcanonical_filenameÚpython_reported_file)Úisolate_module)Úcompile_unicode)Úget_python_sourcec@seZdZdZdd„ZdS)ÚDummyLoaderzzA shim for the pep302 __loader__, emulating pkgutil.ImpLoader.

    Currently only implements the .fullname attribute
    cGs
||_dS)N)Úfullname)Úselfr
Ú_args©rú/build/wlanpi-profiler-7IIg1Q/wlanpi-profiler-1.0.11/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/execfile.pyÚ__init__ szDummyLoader.__init__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rrrrrrsrc
Cs¼ytj |¡}Wn0tk
r@}ztt|ƒƒ|‚Wdd}~XYnX|sTtd|›ƒ‚|j}|j}|jr¤|d}tj |¡}|s˜td|›d|›dƒ‚|j}|j}| 	d¡d}|||fS)z‡Find the module named `modulename`.

    Returns the file path of the module, the name of the enclosing
    package, and the spec.
    NzNo module named z	.__main__z; z- is a package and cannot be directly executedÚ.r)
Ú	importlibÚutilÚ	find_specÚImportErrorrÚstrÚoriginÚnameÚsubmodule_search_locationsÚ
rpartition)Ú
modulenameÚspecÚerrÚpathnameZpackagenameZmod_mainrrrÚfind_module$s& 
r%c@s2eZdZdZddd„Zdd„Zdd„Zd	d
„ZdS)
ÚPyRunnerzwMulti-stage execution of Python code.

    This is meant to emulate real Python execution as closely as possible.

    FcCs8||_||_|d|_d|_|_|_|_|_dS)Nr)ÚargsÚ	as_moduleÚarg0Úpackager!r$Úloaderr")rr'r(rrrrFs
zPyRunner.__init__cCsò|jrtjjrt ¡}qJd}n,tj |j¡r4|j}ntj 	tj 
|j¡¡}tj tjd¡r´t 
¡ddjj}tj 	tjd¡}tj 	tj 
|¡¡}t|ƒ}t|ƒ}||krØd}n$tjdtj 
tjd¡krØtjd=|dk	rît|ƒtjd<dS)zsSet sys.path properly.

        This needs to happen before any importing, and without importing anything.
        ÚréÿÿÿÿNé)r(rÚ
PYBEHAVIORZactual_syspath0_dash_mÚosÚgetcwdÚpathÚisdirr)ÚabspathÚdirnameÚsysÚinspectÚstackÚf_codeÚco_filenamerr)rZpath0Ztop_fileZsys_path_0_absZtop_file_dir_absrrrÚprepareMs&
zPyRunner.preparecCs"|jrd|j|_t|jƒ\}|_|_|jdk	r6|jj|_t|jƒ|_t	j
 |¡|_|j|j
d<|_n®t	j
 |j¡rx\dD]B}t	j
 |jd|¡}tjdkr¨t	j
 |¡}t	j
 |¡rz||_PqzWtd|j›dƒ‚t|ƒ}tjjdd|d|_d	|j_d
|_tdƒ|_n
tdƒ|_t|jƒ|_dS)z§Do more preparation to run Python code.

        Includes finding the module to run and adjusting sys.argv[0].
        This method is allowed to import code.

        Nr)z.pyz.pycz.pyoÚ__main__)ééé
z!Can't find '__main__' module in 'ú')rTr,)r(r)r!r%r*r"rrr+r0r2r4r$r'r3ÚjoinrZ	PYVERSIONÚexistsrrrÚ	machineryÚ
ModuleSpecÚhas_location)rr$ÚextZtry_filenamerrrÚ	_prepare2vs0




zPyRunner._prepare2c

Cs4| ¡t d¡}|j d¡}|j|_|r:|jdd…|_|jdk	rL|j|_|j|_	|j
dk	rf|j
|_tj
d|_|tj
d<|jt_y|r–t|jƒ}n
t|jƒ}Wn\tk
r¸‚YnHtk
rþ}z*d|j›d|jj›d|›}t|ƒ|‚Wdd}~XYnXt ¡}zyt||jƒWntk
r6‚Ynêtk
rt ¡\}}}	t|d	dƒy|jj|_t  |||	j¡Wntk
r–‚Yn„tk
r}zZtj! "d
¡t ¡\}
}}d|_#|jj|_t $|
||j¡tj! "d¡t%|||	jƒ|‚Wdd}~XYnXt &d
¡YnXWdt '|¡XdS)zRun the Python code!r<)z.pycz.pyoNr-ÚbuiltinszCouldn't run 'z' as Python code: z: Ú__context__zError in sys.excepthook:
Tz
Original exception was:
r.)(rGÚtypesÚ
ModuleTyper)ÚendswithÚ__file__r*Ú__package__r+Ú
__loader__r"Ú__spec__r6ÚmodulesÚ__builtins__r'ÚargvÚmake_code_from_pycÚmake_code_from_pyrÚ	ExceptionÚ	__class__rr0r1ÚexecÚ__dict__Ú
SystemExitÚexc_infoÚgetattrÚ
__traceback__Útb_nextÚ
excepthookÚstderrÚwriteÚ__suppress_context__Ú__excepthook__rÚexitÚchdir)
rZmain_modZfrom_pycÚcodeÚexcÚmsgÚcwdÚtypr#ÚtbZtyp2Zerr2Ztb2rrrÚrun s\





"zPyRunner.runN)F)rrrrrr;rGrlrrrrr&@s

)*r&cCs t|dd}| ¡| ¡dS)aRun a Python module, as though with ``python -m name args...``.

    `args` is the argument array to present as sys.argv, including the first
    element naming the module being executed.

    This is a helper for tests, to encapsulate how to use PyRunner.

    T)r(N)r&r;rl)r'ÚrunnerrrrÚrun_python_moduleós	rncCs t|dd}| ¡| ¡dS)aGRun a Python file as if it were the main program on the command line.

    `args` is the argument array to present as sys.argv, including the first
    element naming the file being executed.  `package` is the name of the
    enclosing package, if any.

    This is a helper for tests, to encapsulate how to use PyRunner.

    F)r(N)r&r;rl)r'rmrrrÚrun_python_files
roc
CsVyt|ƒ}Wn8ttfk
rD}ztd|›dƒ|‚Wdd}~XYnXt||dƒ}|S)z8Get source from `filename` and make a code object of it.zNo file to run: 'r@NrX)rÚOSErrorrr
)ÚfilenameÚsourcergrfrrrrUs$rUc
CsÜyt|dƒ}Wn4tk
rB}ztd|›dƒ|‚Wdd}~XYnX|Š| d¡}|tkrptd|›dt›ƒ‚d}tjjr¬t 	d	| d¡¡d
}|d@}|r¬| d¡d
}|rÄ| d¡| d¡t
 |¡}WdQRX|S)z#Get a code object from a .pyc file.ÚrbzNo file to run: 'r@NézBad magic number in .pyc file: z != Tz<Lrr.r>F)ÚopenrprÚreadÚPYC_MAGIC_NUMBERrr/Zhashed_pyc_pep552ÚstructÚunpackÚmarshalÚload)rqZfpycrgÚmagicZ
date_basedÚflagsÚ
hash_basedrfrrrrTs($



rT)$rÚimportlib.machineryrÚimportlib.utilr7rzr0rxr6rJZcoveragerZcoverage.exceptionsrrrrZcoverage.filesrrZ
coverage.miscr	Zcoverage.phystokensr
Zcoverage.pythonrrÚMAGIC_NUMBERrwrr%r&rnrorUrTrrrrÚ<module>s0	4