• File: depends.cpython-36.opt-1.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python3.6/site-packages/setuptools/__pycache__/depends.cpython-36.opt-1.pyc
  • Date Modified: 10/18/2026 11:59 PM
  • File size: 5.09 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
3

l]j@sddlZddlZddlZddlmZddlmZmZmZmZddl	m
Z
dddd	gZGd
ddZdddZ
dddZdd
d	ZddZedS)N)
StrictVersion)
PKG_DIRECTORYPY_COMPILED	PY_SOURCE	PY_FROZEN)BytecodeRequirefind_moduleget_module_constantextract_constantc@sHeZdZdZdddZddZdd	ZdddZdd
dZdddZ	dS)r	z7A prerequisite to building or installing a distributionNcCsF|dkr|dk	rt}|dk	r0||}|dkr0d}|jjt|`dS)N__version__)r__dict__updatelocalsself)rnamerequested_versionmoduleZhomepage	attributeformatr/usr/lib/python3.6/depends.py__init__szRequire.__init__cCs |jdk	rd|j|jfS|jS)z0Return full package/distribution name, w/versionNz%s-%s)rr)rrrr	full_name s
zRequire.full_namecCs*|jdkp(|jdkp(t|dko(||jkS)z%Is 'version' sufficiently up-to-date?Nunknown)rrstrr)rversionrrr
version_ok&szRequire.version_okrc
Cs||jdkrBy"t|j|\}}}|r*|j|Stk
r@dSXt|j|j||}|dk	rx||k	rx|jdk	rx|j|S|S)aGet version number of installed module, 'None', or 'default'

        Search 'paths' for module.  If not found, return 'None'.  If found,
        return the extracted version attribute, or 'default' if no version
        attribute was specified, or the value cannot be determined without
        importing the module.  The version is formatted according to the
        requirement's version format (if any), unless it is 'None' or the
        supplied 'default'.
        N)rr
rcloseImportErrorrr)rpathsdefaultfpivrrrget_version+s

zRequire.get_versioncCs|j|dk	S)z/Return true if dependency is present on 'paths'N)r()rr"rrr
is_presentFszRequire.is_presentcCs |j|}|dkrdS|j|S)z>Return true if dependency is present and up-to-date on 'paths'NF)r(r)rr"rrrr
is_currentJs
zRequire.is_current)r
NN)Nr)N)N)
__name__
__module____qualname____doc__rrrr(r)r*rrrrr	s



c
Csl|jd}x\|rf|jd}tj||\}}\}}}}	|tkrP|pFdg}|g}q|rtd||fqW|	S)z7Just like 'imp.find_module()', but with package support.rrzCan't find %r in %s)splitpopimpr
rr!)
rr"partspartr$pathsuffixmodekindinforrrr
Rs


c
Csyt||\}}\}}}Wntk
r.dSXz|tkrP|jdtj|}	n`|tkrdtj|}	nL|t	kr~t
|j|d}	n2|tjkrtj
||||||fttj||dSWd|r|jXt|	||S)zFind 'module' by searching 'paths', and extract 'symbol'

    Return 'None' if 'module' does not exist on 'paths', or it does not define
    'symbol'.  If the module defines 'symbol' as a constant, return the
    constant.  Otherwise, return 'default'.Nexec)r
r!rreadmarshalloadrr2get_frozen_objectrcompilesysmodulesload_modulegetattrr r)
rsymbolr#r"r$r5r6r7r8coderrrres$


cCs||jkrdSt|jj|}d}d}d}|}xPt|D]D}|j}	|j}
|	|kr\|j|
}q8|
|krx|	|kst|	|krx|S|}q8WdS)aExtract the constant value of 'symbol' from 'code'

    If the name 'symbol' is bound to a constant value by the Python code
    object 'code', return that value.  If 'symbol' is bound to an expression,
    return 'default'.  Otherwise, return 'None'.

    Return value is based on the first assignment to 'symbol'.  'symbol' must
    be a global, or at least a non-"fast" local in the code block.  That is,
    only 'STORE_NAME' and 'STORE_GLOBAL' opcodes are checked, and 'symbol'
    must be present in 'code.co_names'.
    NZad)co_nameslistindexrZopcodearg	co_consts)rFrEr#Zname_idxZ
STORE_NAMEZSTORE_GLOBALZ
LOAD_CONSTconstZ	byte_codeoprMrrrrs
cCsDtjjdrtjdkrdSd}x|D]}t|=tj|q&WdS)z
    Patch the globals to remove the objects not available on some platforms.

    XXX it'd be better to test assertions about bytecode instead.
    javaZcliNrr)rr)rAplatform
startswithglobals__all__remove)Zincompatiblerrrr_update_globalss
rW)N)rXNrX)rX)rAr2r=Zdistutils.versionrrrrrZ
py33compatrrUr	r
rrrWrrrr<module>sC

"
$