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

¨ºáª\Ábiã@s´ddlmZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlmZddl
mZmZmZmZmZmZe e¡Zd ¡Ze d¡Zd	Zd
d„ZeZGdd
„d
eƒZdS)é)ÚBytesIONé)Ú	sysconfigÚdetect_encodingÚZipFile)Úfinder)ÚFileOperatorÚget_export_entryÚconvert_pathÚget_executableÚget_platformÚin_venvañ
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 <assemblyIdentity version="1.0.0.0"
 processorArchitecture="X86"
 name="%s"
 type="win32"/>

 <!-- Identify the application security requirements. -->
 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
 <security>
 <requestedPrivileges>
 <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
 </requestedPrivileges>
 </security>
 </trustInfo>
</assembly>s^#!.*pythonw?[0-9.]*([ 	].*)?$zÍ# -*- coding: utf-8 -*-
import re
import sys
from %(module)s import %(import_name)s
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(%(func)s())
cCsXd|krT| d¡rB| dd¡\}}d|krT| d¡sTd||f}n| d¡sTd|}|S)Nú z
/usr/bin/env rú"z%s "%s"z"%s")Ú
startswithÚsplit)Ú
executableÚenvÚ_executable©rúŽ/build/wlanpi-profiler-7IIg1Q/wlanpi-profiler-1.0.11/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/distlib/scripts.pyÚenquote_executable3s

rc@sæeZdZdZeZdZd*dd„Zdd„Ze	j
 d	¡rBd
d„Zdd
„Z
dd„Zd+dd„Zdd„ZeZdd„Zdd„ZdZdd„Zd,dd„Zdd„Zed d!„ƒZejd"d!„ƒZejd#ksÆejd	krÎejd#krÎd$d%„Zd-d&d'„Z d.d(d)„Z!dS)/ÚScriptMakerz_
    A class to copy or create scripts from source scripts or callable
    specifications.
    NTFcCs‚||_||_||_d|_d|_tjdkp:tjdko:tjdk|_t	dƒ|_
|pRt|ƒ|_tjdkprtjdkortjdk|_
tj|_dS)NFÚposixÚjava)ÚzX.YÚnt)Ú
source_dirÚ
target_dirÚ
add_launchersÚforceÚclobberÚosÚnameÚ_nameÚset_modeÚsetÚvariantsrÚ_fileopÚ_is_ntÚsysÚversion_info)ÚselfrrrÚdry_runÚfileoprrrÚ__init__Ns

zScriptMaker.__init__cCs@| dd¡r<|jr<tj |¡\}}| dd¡}tj ||¡}|S)NÚguiFÚpythonÚpythonw)Úgetr)r"ÚpathrÚreplaceÚjoin)r,rÚoptionsÚdnÚfnrrrÚ_get_alternate_executable_s
z%ScriptMaker._get_alternate_executablerc	CsLy"t|ƒ}| d¡dkSQRXWn$ttfk
rFt d|¡dSXdS)zl
            Determine if the specified executable is a script
            (contains a #! line)
            éz#!NzFailed to open %sF)ÚopenÚreadÚOSErrorÚIOErrorÚloggerÚwarning)r,rÚfprrrÚ	_is_shellgs
zScriptMaker._is_shellcCsD| |¡r*ddl}|jj d¡dkr<|Sn| ¡ d¡r<|Sd|S)Nrzos.nameÚLinuxz
jython.exez/usr/bin/env %s)rCrÚlangÚSystemÚgetPropertyÚlowerÚendswith)r,rrrrrÚ_fix_jython_executabless
z"ScriptMaker._fix_jython_executablecCs‚tjdkrd}n8t|ƒt|ƒd}tjdkr4d}nd}d|koF||k}|r^d||d	}n d
}|d||d7}|d
7}|S)a
        Build a shebang line. In the simple case (on Windows, or a shebang line
        which is not too long or contains spaces) use a simple formulation for
        the shebang. Otherwise, use /bin/sh as the executable, with a contrived
        shebang which allows the script to run either under Python or sh, using
        suitable quoting. Thanks to Harald Nordgren for his input.

        See also: http://www.in-ulm.de/~mascheck/various/shebang/#length
                  https://hg.mozilla.org/mozilla-central/file/tip/mach
        rTéÚdarwiniéó s#!ó
s
#!/bin/sh
s	'''exec' s "$0" "$@"
s' ''')r"r#Úlenr*Úplatform)r,rÚpost_interpÚsimple_shebangÚshebang_lengthÚmax_shebang_lengthÚresultrrrÚ_build_shebangs

zScriptMaker._build_shebangócCs~d}|jr|j}d}nˆt ¡s&tƒ}nxtƒrLtj t d¡dt 	d¡¡}nRtj t 	d¡dt 	d¡t 	d¡f¡}tj 
|¡sžtj t 	d¡dt 	d¡¡}|r®| ||¡}tj
 d	¡rÄ| |¡}|rÐt|ƒ}| d
¡}tj
dkrüd|krüd
|krü|d7}| ||¡}y| d
¡Wn"tk
r8td|ƒ‚YnX|d
krzy| |¡Wn&tk
rxtd||fƒ‚YnX|S)NTFÚscriptszpython%sÚEXEÚBINDIRz
python%s%sÚVERSIONrzutf-8Úcliz	-X:Framesz
-X:FullFramess
 -X:Framesz,The shebang (%r) is not decodable from utf-8z?The shebang (%r) is not decodable from the script encoding (%r))rrÚis_python_buildrr
r"r4r6Úget_pathÚget_config_varÚisfiler:r*rQrrJrÚencoderWÚdecodeÚUnicodeDecodeErrorÚ
ValueError)r,ÚencodingrRr7ÚenquoterÚshebangrrrÚ_get_shebangžsP




zScriptMaker._get_shebangcCs$|jt|j|j d¡d|jdS)NÚ.r)ÚmoduleÚimport_nameÚfunc)Úscript_templateÚdictÚprefixÚsuffixr)r,ÚentryrrrÚ_get_script_textãs
zScriptMaker._get_script_textcCstj |¡}|j|S)N)r"r4ÚbasenameÚmanifest)r,ÚexenameÚbaserrrÚget_manifestêszScriptMaker.get_manifestcCsú|jo
|j}tj d¡}| |¡s*||7}|s8||}nZ|dkrL| d¡}n
| d¡}tƒ}	t|	dƒ}
|
 	d|¡WdQRX|	 
¡}|||}x`|D]V}tj |j
|¡}
|r|tj |
¡\}}| d¡rÔ|}
d|
}
y|j |
|¡WnŠtk
rxt d¡d	|
}tj |¡r*t |¡t |
|¡|j |
|¡t d
¡yt |¡Wntk
rrYnXYnXnl|jr |
 d|¡s d|
|f}
tj |
¡rÄ|jsÄt d
|
¡qš|j |
|¡|jrè|j |
g¡| |
¡qšWdS)Nzutf-8ÚpyÚtÚwz__main__.pyz.pyz%s.exez:Failed to write executable - trying to use .deleteme logicz%s.deletemez0Able to replace executable using .deleteme logicrjz%s.%szSkipping existing file %s)rr)r"ÚlineseprbrIÚ
_get_launcherrrÚwritestrÚgetvaluer4r6rÚsplitextrr(Úwrite_binary_fileÚ	Exceptionr@rAÚexistsÚremoveÚrenameÚdebugr!r%Úset_executable_modeÚappend)r,ÚnamesrhÚscript_bytesÚ	filenamesÚextÚuse_launcherr|ÚlauncherÚstreamÚzfÚzip_datar#ÚoutnameÚnÚeÚdfnamerrrÚ
_write_scriptîsX






zScriptMaker._write_scriptú-cCsntƒ}d|jkr| |¡d|jkr<| d||jdf¡d|jkrj| d||j|jd|jdf¡|S)NrÚXz%s%srzX.Yz	%s%s%s.%sr)r&r'Úaddr+Úvariant_separator)r,r#rVrrrÚget_script_filenames$s



z ScriptMaker.get_script_filenamesc
CsŒd}|r0| dg¡}|r0dd |¡}| d¡}|jd||d}| |¡ d¡}| |j¡}|rr| dd¡rrd	}	nd
}	| |||||	¡dS)NrXÚinterpreter_argsz %srzutf-8)r7r0FÚpywry)r3r6rbrirsr›r#r–)
r,rrr‹r7rRÚargsrhÚscriptÚscriptnamesrŒrrrÚ_make_script/s
zScriptMaker._make_scriptcCsd}tj |jt|ƒ¡}tj |jtj |¡¡}|jsT|j 	||¡sTt
 d|¡dSyt|dƒ}Wn t
k
r‚|jsz‚d}YnFX| ¡}|s t
 d|¡dSt | dd¡¡}|rÈd}| d¡pÆd	}|s|rÚ| ¡|j ||¡|jrü|j |g¡| |¡n„t
 d
||j¡|jjs~t|jƒ\}	}
| d¡| |	|¡}d|krVd
}nd}tj |¡}
| |
g|| ¡||¡|rŒ| ¡dS)NFznot copying %s (up-to-date)Úrbz%s is an empty file (skipping)s
rOTrrXzcopying and adjusting %s -> %srspythonwrry) r"r4r6rr
rrtr r(Únewerr@r†r<r?r-ÚreadlinerAÚ
FIRST_LINE_REÚmatchr5ÚgroupÚcloseÚ	copy_filer%r‡rˆÚinforÚseekrir–r=)r,rŸr‹Úadjustr’ÚfÚ
first_liner¦rRrfÚlinesrhrŒr“rrrÚ_copy_script?sP



zScriptMaker._copy_scriptcCs|jjS)N)r(r-)r,rrrr-rszScriptMaker.dry_runcCs||j_dS)N)r(r-)r,Úvaluerrrr-vsrcCstt d¡dkrd}nd}tƒdkr&dnd}d|||f}t d	d
¡d}t|ƒ |¡}|snd||f}t|ƒ‚|jS)
NÚPéZ64Z32z	win-arm64z-armrz
%s%s%s.exerjrrz(Unable to find resource %s in package %s)	ÚstructÚcalcsizerÚ__name__ÚrsplitrÚfindreÚbytes)r,ÚkindÚbitsZplatform_suffixr#Zdistlib_packageÚresourceÚmsgrrrr}~szScriptMaker._get_launchercCs6g}t|ƒ}|dkr"| ||¡n|j|||d|S)aÓ
        Make a script.

        :param specification: The specification, which is either a valid export
                              entry specification (to make a script from a
                              callable) or a filename (to make a script by
                              copying from a source location).
        :param options: A dictionary of options controlling script generation.
        :return: A list of all absolute pathnames written to.
        N)r7)r	r°r¡)r,Ú
specificationr7r‹rrrrrÚmake‘szScriptMaker.makecCs(g}x|D]}| | ||¡¡q
W|S)zÂ
        Take a list of specifications and make scripts from them,
        :param specifications: A list of specifications.
        :return: A list of all absolute pathnames written to,
        )Úextendr¿)r,Úspecificationsr7r‹r¾rrrÚ
make_multiple¤s
zScriptMaker.make_multiple)TFN)rXN)N)N)N)"r¶Ú
__module__Ú__qualname__Ú__doc__ÚSCRIPT_TEMPLATErnrr/r:r*rQrrCrJrWrirsÚ_DEFAULT_MANIFESTrurxr–ršr›r¡r°Úpropertyr-Úsetterr"r#r$r}r¿rÂrrrrrEs2

E4
3
r) ÚiorÚloggingr"Úrer´r*ÚcompatrrrÚ	resourcesrÚutilrr	r
rrr
Ú	getLoggerr¶r@ÚstriprÇÚcompiler¥rÆrÚ_enquote_executableÚobjectrrrrrÚ<module>s