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

zï8tªäVÒã@sdZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddl	mZmZm
Z
ddlmZmZddlmZmZmZmZmZddlmZdd	lmZeeƒZGd
d„deƒZe
rÊdd
„Zndd
„ZGdd„deƒZdd„Zdd„Z dd„Z!dd„Z"dS)zExecute files of Python code.éN)Úenv)ÚBUILTINS)ÚPYC_MAGIC_NUMBERÚimpÚimportlib_util_find_spec)Úcanonical_filenameÚpython_reported_file)ÚCoverageExceptionÚExceptionDuringRunÚNoCodeÚNoSourceÚ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-MIf3Xw/wlanpi-profiler-1.0.8/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/execfile.pyÚ__init__szDummyLoader.__init__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rrrrrrsrc
Cs¨yt|ƒ}Wn.tk
r:}ztt|ƒƒ‚Wdd}~XYnX|sNtd|fƒ‚|j}|j}|jr|d}t|ƒ}|s„td||fƒ‚|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 %rz	.__main__zCNo module named %s; %r is a package and cannot be directly executedÚ.r)rÚImportErrorrÚstrÚoriginÚnameÚsubmodule_search_locationsÚ
rpartition)Ú
modulenameÚspecÚerrÚpathnameÚpackagenameZmod_mainrrrÚfind_module"s&r'c
Cs
d}tƒtƒ}}zÜy¨d|krF| dd¡\}}t|||dgƒ}|j}nd|}}d}t ||¡\}}}	|dkr‚|dkr‚td|ƒ‚|dkrº|}d}t|||dgƒ}|j}t ||¡\}}}	Wn.tk
rê}
ztt	|
ƒƒ‚Wdd}
~
XYnXWd|rþ| 
¡X||dfS)z®Find the module named `modulename`.

        Returns the file path of the module, the name of the enclosing
        package, and None (where a spec would have been).
        NréÚ__path__z"module does not live in a file: %rÚ__main__)ÚglobalsÚlocalsÚrsplitÚ
__import__r)rr'rrrÚclose)r"ZopenfileZgloÚlocr&rÚpackageZ
searchpathr%Ú_r$rrrr'>s0

"
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Úarg0r1r"r%Úloaderr#)rr4r5rrrros
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éÿÿÿÿNr()r5rÚ
PYBEHAVIORZactual_syspath0_dash_mÚosÚgetcwdÚpathÚisdirr6ÚabspathÚdirnameÚsysÚinspectÚstackÚf_codeÚco_filenamerr)rZpath0Ztop_fileZsys_path_0_absZtop_file_dir_absrrrÚpreparevs&
zPyRunner.preparecCsH|jrd|j|_t|jƒ\}|_|_|jdk	r6|jj|_t|jƒ|_t	j
 |¡|_|j|j
d<|_nÔt	j
 |j¡r&xBdD],}t	j
 |jd|¡}t	j
 |¡rz||_PqzWtd|jƒ‚tjrÎt	j
 |j¡|_yddl}Wntk
rîYn&Xt|ƒ}|jjdd|d|_d|j_d|_tdƒ|_ntjr8tdƒ|_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.pyor*z$Can't find '__main__' module in '%s')rTr8)r5r6r"r'r1r#rrr7r;r=r?r%r4r>ÚjoinÚexistsrrÚPY2Úimportlib.machineryrrÚ	machineryÚ
ModuleSpecÚhas_locationÚPY3)rr%ÚextZtry_filenameÚ	importlibrrrÚ	_prepare2Ÿs:



zPyRunner._prepare2c
Cs(| ¡t d¡}|j d¡}|j|_|r:|jdd…|_|jdk	rL|j|_|j|_	|j
dk	rf|j
|_t|_
|tjd<|jt_y|rt|jƒ}n
t|jƒ}WnNtk
r²‚Yn:tk
rê}zd}t|j|j|dƒ‚Wdd}~XYnXt ¡}z yt||jƒWntk
r"‚Ynòtk
rt ¡\}}}	t|ddƒy*t|dƒrd|jj |_t !|||	j ¡WnŒtk
rŽ‚Yn€tk
rtj" #d	¡t ¡\}
}}d
|_$t|dƒrÔ|jj |_t %|
||j ¡tj" #d¡t&|||	j ƒ‚YnXt 'd¡YnXWdt (|¡XdS)
zRun the Python code!r*)z.pycz.pyoNr9zICouldn't run '{filename}' as Python code: {exc.__class__.__name__}: {exc})ÚfilenameÚexcÚ__context__Ú
__traceback__zError in sys.excepthook:
Tz
Original exception was:
r())rQÚtypesÚ
ModuleTyper6ÚendswithÚ__file__r1Ú__package__r7Ú
__loader__r#Ú__spec__rÚ__builtins__rAÚmodulesr4ÚargvÚmake_code_from_pycÚmake_code_from_pyr	Ú	ExceptionÚformatr;r<ÚexecÚ__dict__Ú
SystemExitÚexc_infoÚgetattrÚhasattrrUÚtb_nextÚ
excepthookÚstderrÚwriteÚ__suppress_context__Ú__excepthook__r
ÚexitÚchdir)
rZmain_modZfrom_pycÚcoderSÚmsgÚcwdÚtypr$ÚtbZtyp2Zerr2Ztb2rrrÚrunÍs`



&

zPyRunner.runN)F)rrrrrrFrQrwrrrrr3is

).r3cCs 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)r5N)r3rFrw)r4ÚrunnerrrrÚrun_python_module"s	rycCs 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)r5N)r3rFrw)r4rxrrrÚrun_python_file0s
rzc	CsByt|ƒ}Wn$ttfk
r0td|ƒ‚YnXt||dƒ}|S)z8Get source from `filename` and make a code object of it.zNo file to run: '%s'rd)rÚIOErrorrr)rRÚsourcerrrrrra?srac	CsÌyt|dƒ}Wn tk
r.td|ƒ‚YnX|Ž| d¡}|tkrXtd |t¡ƒ‚d}tjjr”t	 
d| d¡¡d}|d@}|r”| d	¡d
}|r´| d¡tjjr´| d¡t 
|¡}WdQRX|S)z#Get a code object from a .pyc file.ÚrbzNo file to run: '%s'éz'Bad magic number in .pyc file: {} != {}Tz<Lrr(éFN)Úopenr{rÚreadrrcrr:Zhashed_pyc_pep552ÚstructÚunpackZsize_in_pycÚmarshalÚload)rRZfpycÚmagicZ
date_basedÚflagsÚ
hash_basedrrrrrr`Ks*



r`)#rrBr„r;r‚rArVZcoveragerZcoverage.backwardrrrrZcoverage.filesrrZ
coverage.miscr	r
rrr
Zcoverage.phystokensrZcoverage.pythonrÚobjectrr'r3ryrzrar`rrrrÚ<module>s0	
+: