HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/share/dh-python/dhpython/build/__pycache__/base.cpython-35.pyc


vX"@sddlZddlmZddlmZddlmZmZddlm	Z	m
Z
mZddlm
Z
mZddlmZmZddlmZydd	lmZWnek
rd
dZYnXejdZGd
ddZddZdS)N)wraps)glob1)removewalk)existsisdirjoin)PopenPIPE)rmtreecopytree)execute)quotecCs"|s
dSd|jdddS)Nz'''z'"'"')replace)sr+/usr/share/dh-python/dhpython/build/base.pyr!srZdhpythonc@seZdZdZdZgZgZiZddddddhZd	d
Z	ddZ
ed
dZddZ
ddZddZddZddZddZdddZdS)BaseaBase class for build system plugins

    :attr REQUIRED_COMMANDS: list of command checked by default in :meth:is_usable,
        if one of them is missing, plugin cannot be used.
    :type REQUIRED_COMMANDS: list of strings
    :attr REQUIRED_FILES: list of files (or glob templates) required by given
        build system
    :attr OPTIONAL_FILES: dictionary of glob templates (key) and score (value)
        used to detect if given plugin is the best one for the job
    :type OPTIONAL_FILES: dict (key is a string, value is an int)
    :attr SUPPORTED_INTERPRETERS: set of interpreter templates (with or without
        {version}) supported by given plugin
    pythonpython3z
python-dbgzpython3-dbgzpython{version}zpython{version}-dbgcCs
||_dS)N)cfg)selfrrrr__init__>sz
Base.__init__cCsd|jS)NzBuildSystem(%s))NAME)rrrr__repr__Asz
Base.__repr__cCsgx`|jD]U}td|gdtdt}|j\}}|jdkr
td|q
WdS)NZwhichstdoutstderrrzmissing command: %s)REQUIRED_COMMANDSr	r
Zcommunicate
returncode	Exception)clscommandZprocesouterrrrr	is_usableDs
zBase.is_usablec	Cs:d}d}i|_x||jD]q}d}xR|jdD]A}t|d|}|r;d}|jj|gj|q;W|r|d7}qW|jr|t|t|jd7}i|_x\|j	j
D]K\}}t|d|}|r||7}|jj|gj|qW|dkr6dS|S)	aJReturn certainty level that this plugin describes the right build system

        This method is using cls.{REQUIRED,OPTIONAL}_FILES only by default,
        please extend it in the plugin if more sofisticated methods can be used
        for given build system.

        :return: 0 <= certainty <= 100
        :rtype: int
        rF|dirT2d)ZDETECTED_REQUIRED_FILESREQUIRED_FILESsplitr
setdefaultextendintlenZDETECTED_OPTIONAL_FILESOPTIONAL_FILESitems)	rcontextresultZrequired_files_numZtplfoundZftplresZscorerrrdetectLs.
	 	!	
 zBase.detectcCst|jjr^t|dd}t|r^yt|Wn"tk
r]tjd|YnXxt|dD]\}}}xy|D]q}|dkrt||}tjd|yt|Wn"tk
rtjd|YqX|j	|qWxo|D]g}	|	j
d	rt||	}
tjd|
yt	|
Wqtk
rgtjd|
YqXqWqoWdS)
Nr(z.toxzcannot remove %s__pycache__zremoving dir: %s.pyc.pyozremoving: %s)r:r;)rtest_toxrrrr!logdebugrrendswith)rr4argsZtox_dirrootdirsZ
file_namesnameZdpathfnZfpathrrrcleanqs2
 



z
Base.cleancCstd|jdS)Nz&configure method not implemented in %s)NotImplementedErrorr)rr4r@rrr	configureszBase.configurecCstd|jdS)Nz$install method not implemented in %s)rFr)rr4r@rrrinstallszBase.installcCstd|jdS)Nz"build method not implemented in %s)rFr)rr4r@rrrbuildsz
Base.buildc	CsRt}xdD]}t|d|}t|d|}t|rt|srt|||j|d|drd|dkr|jjs|jjr||d<qW|rt	t|d	d
d}|j
|WdQRX|jjrdS|jjrd
S|jjrdS|ddksJ|dd?sJ|ddkrNdSdS)Ntesttestsr(Z	build_dir
r@ZPYBUILD_TEST_ARGSENVhome_dirZbuild_dirs_to_rm_before_installwz,cd {build_dir}; {interpreter} -m nose {args}z.cd {build_dir}; {interpreter} -m pytest {args}zHcd {build_dir}; tox -c {dir}/tox.ini -e py{version.major}{version.minor}versionz2.7z3.1interpreterZpypyz<cd {build_dir}; {interpreter} -m unittest discover -v {args})rJrK)setrrrraddrZtest_pytestZ	test_noseopen
writelinesr<)rr4r@Zdirs_to_removeZdnameZ	src_dpathZ	dst_dpathfprrrrJs,	

.z	Base.testNcCs|dkr|jjrd}|j|}d|krZt|d}|d|d<n
|d}tj|t||d||S)NF
PYTHONPATHrMr()rZreally_quietformatdictr=infor
)rr4r@r#log_fileenvrrrr
s

zBase.execute)__name__
__module____qualname____doc__ZDESCRIPTIONrr,r2ZSUPPORTED_INTERPRETERSrrclassmethodr&r8rErGrHrIrJr
rrrrr)s"
%rcs"tfdd}|S)Nc
sG|jdd}|sC|||||}t|trC|S|s~tjd|jj|jd|jd|S|jj	rt
|ddjj}nd}tdd	|j
D}|j|}|j||||}|d
dkrCdj|d
|}	|r7|	d
j|7}	t|	dS)Nr#zBmissing command (plugin=%s, method=%s, interpreter=%s, version=%s)rQrPrNz
{}_cmd.logFcssN|]D\}}|dks*|jdr<|t|fn	||fVqdS)r(destdirZ_dirN)r(rb)r?r).0kvrrr	<genexpr>sz6shell_command.<locals>.wrapped_func.<locals>.<genexpr>r rzexit code={}: {}z$
full command log is available in {}T)pop
isinstancer0r=warnrr]getrquietrrXrYr3r
r!)
rr4r@Zoargskwargsr#r[Zquoted_argsoutputmsg)funcrrwrapped_funcs.	"z#shell_command.<locals>.wrapped_func)r)rorpr)ror
shell_commands rq)Zlogging	functoolsrZglobrosrros.pathrrr
subprocessr	r
ZshutilrrZdhpython.toolsr
ZshlexrImportErrorZ	getLoggerr=rrqrrrr<module>s