Repository URL to install this package:
|
Version:
1.0.11 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
distlib
/
__pycache__
/
scripts.cpython-37.pyc
|
|---|
B
¨ºáª\Ábiã @ s´ d dl mZ d dlZd dlZd dlZd dlZd dlZddlmZm Z m
Z
ddlmZ ddl
mZmZmZmZmZmZ e e¡Zd ¡ Ze d¡Zd Zd
d ZeZG dd
d
eZdS )é )Ú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())
c C sX d| 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_executable3 s
r c @ sæ e Zd ZdZeZdZd*ddZdd Ze j
d ¡rBd
d Zdd
Z
dd Zd+ddZdd ZeZdd Zdd ZdZdd Zd,ddZdd 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.
NTFc C s || _ || _|| _d| _d| _tjdkp:tjdko:tjdk| _t d| _
|pRt|| _tjdkprtjdkortjdk| _
tj| _d S )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)Úselfr r r Údry_runÚfileopr r r Ú__init__N s
zScriptMaker.__init__c C s@ | dd¡r<| jr<tj |¡\}}| dd¡}tj ||¡}|S )NÚguiFÚpythonÚpythonw)Úgetr) r" Úpathr ÚreplaceÚjoin)r, r ÚoptionsÚdnÚfnr r r Ú_get_alternate_executable_ s
z%ScriptMaker._get_alternate_executabler c C sL y"t |}| d¡dkS Q R X W n$ ttfk
rF t d|¡ dS X dS )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 Úfpr r r Ú _is_shellg s
zScriptMaker._is_shellc C sD | |¡r*dd l}|jj d¡dkr<|S n| ¡ d¡r<|S d| S )Nr zos.nameÚLinuxz
jython.exez/usr/bin/env %s)rC r ÚlangÚSystemÚgetPropertyÚlowerÚendswith)r, r r r r r Ú_fix_jython_executables s
z"ScriptMaker._fix_jython_executablec C s t jdkrd}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
r Té Ú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Úresultr r r Ú_build_shebang s
zScriptMaker._build_shebangó c C s~ d}| j r| j }d}nt ¡ s&t }nxt rLtj t d¡dt d¡ ¡}nRtj t d¡dt d¡t d¡f ¡}tj
|¡stj t d¡dt d¡ ¡}|r®| ||¡}tj
d ¡rÄ| |¡}|rÐt|}| d
¡}tj
dkrüd|krüd
|krü|d7 }| ||¡}y| d
¡ W n" tk
r8 td| Y nX |d
krzy| |¡ W n& tk
rx td||f Y nX |S )NTFÚscriptszpython%sÚEXEÚBINDIRz
python%s%sÚVERSIONr zutf-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))r r Úis_python_buildr r
r" r4 r6 Úget_pathÚget_config_varÚisfiler: r* rQ r rJ r ÚencoderW ÚdecodeÚUnicodeDecodeErrorÚ
ValueError)r, ÚencodingrR r7 Úenquoter Úshebangr r r Ú_get_shebang sP
zScriptMaker._get_shebangc C s$ | j t|j|j d¡d |jd S )NÚ.r )ÚmoduleÚimport_nameÚfunc)Úscript_templateÚdictÚprefixÚsuffixr )r, Úentryr r r Ú_get_script_textã s
zScriptMaker._get_script_textc C s t j |¡}| j| S )N)r" r4 ÚbasenameÚmanifest)r, ÚexenameÚbaser r r Úget_manifestê s zScriptMaker.get_manifestc C sú | j o
| j}tj d¡}| |¡s*||7 }|s8|| }nZ|dkrL| d¡}n
| d¡}t } t| d}
|
d|¡ W d Q R X |
¡ }|| | }x`|D ]V}tj | j
|¡}
|r|tj |
¡\}}| d¡rÔ|}
d|
}
y| j |
|¡ W n tk
rx t d¡ d |
}tj |¡r*t |¡ t |
|¡ | j |
|¡ t d
¡ yt |¡ W n tk
rr Y nX Y nX nl| jr |
d| ¡s d|
|f }
tj |
¡rÄ| jsÄt d
|
¡ q| j |
|¡ | jrè| j |
g¡ | |
¡ qW d S )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 logicrj z%s.%szSkipping existing file %s)r r) r" Úlineseprb rI Ú
_get_launcherr r ÚwritestrÚgetvaluer4 r6 r Úsplitextr r( Ú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Údfnamer r r Ú
_write_scriptî sX
zScriptMaker._write_scriptú-c C sn t }d| jkr| |¡ d| jkr<| d|| jd f ¡ d| jkrj| d|| j| jd | jd f ¡ |S )Nr ÚXz%s%sr zX.Yz %s%s%s.%sr )r&