
    ??h{                         d dl Z d dlZd dlZd dlZd dlmZ ddlmZmZm	Z	m
Z
 ddlmZ g dZ G d d          Zd	 ZddZddZd Z e             dS )    N)version   )find_modulePY_COMPILED	PY_FROZEN	PY_SOURCE)_imp)Requirer   get_module_constantextract_constantc                   B    e Zd ZdZ	 	 ddZd Zd ZddZdd	Zdd
Z	dS )r
   z7A prerequisite to building or installing a distribution Nc                     ||t           j        }| ||          }|d}| j                            t	                                 | `d S )N__version__)r   Version__dict__updatelocalsself)r   namerequested_versionmodulehomepage	attributeformats          ~/var/www/bergmannlarsen.dk/public_html/jacob/powerbi_app_native_visual/venv/lib/python3.11/site-packages/setuptools/depends.py__init__zRequire.__init__   s[     >/;_F &'8 9 9 )	VXX&&&III    c                 @    | j         | j        d| j         S | j        S )z0Return full package/distribution name, w/versionN-)r   r   )r   s    r   	full_namezRequire.full_name#   s*    !-"iii)?)?@@yr   c                     | j         du p9| j        du p0t          |          dk    o|                     |          | j        k    S )z%Is 'version' sufficiently up-to-date?Nunknown)r   r   strr   )r   r   s     r   
version_okzRequire.version_ok)   sN    ~% Y)< YLLI%X$++g*>*>$BX*X	Yr   r#   c                    | j         C	 t          | j        |          \  }}}|r|                                 |S # t          $ r Y dS w xY wt          | j        | j         ||          }| ||ur| j        |                     |          S |S )a  Get 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)r   r   r   closeImportErrorr   r   )r   pathsdefaultfpivs          r   get_versionzRequire.get_version.   s     >!%dk5991a GGIII   tt  T^WeLL=Qg--$+2I;;q>>!s   0: 
AAc                 0    |                      |          duS )z/Return true if dependency is present on 'paths'N)r/   )r   r)   s     r   
is_presentzRequire.is_presentI   s    &&d22r   c                 x    |                      |          }|dS |                     t          |                    S )z>Return true if dependency is present and up-to-date on 'paths'NF)r/   r%   r$   )r   r)   r   s      r   
is_currentzRequire.is_currentM   s7    ""5))?5s7||,,,r   )r   NN)Nr#   N)
__name__
__module____qualname____doc__r   r!   r%   r/   r1   r3    r   r   r
   r
      s        AA =?#'     Y Y Y
   63 3 3 3- - - - - -r   r
   c                 l    t           j        d             }| s
 |            S t          j        |           S )Nc               3      K   d V  d S r4   r9   r9   r   r   emptyzmaybe_close.<locals>.emptyV   s      r   )
contextlibcontextmanagerclosing)r+   r<   s     r   maybe_closer@   U   sE        uwwa   r   c                 <   	 t          | |          x\  }}\  }}}}	n# t          $ r Y dS w xY wt          |          5  |t          k    r*|                    d           t          j        |          }
n|t          k    rt          j	        | |          }
nb|t          k    r$t          |                                |d          }
n3t          j        | ||	          }t          ||d          cddd           S ddd           n# 1 swxY w Y   t          |
||          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'.N   exec)r   r(   r@   r   readmarshalloadr   r	   get_frozen_objectr   compile
get_modulegetattrr   )r   symbolr*   r)   r+   pathsuffixmodekindinfocodeimporteds               r   r   r   `   s~   /:65/I/II%4%&$   tt 
Q 3 3;FF1III<??DDY)&%88DDY16688T622DD vud;;H8VT223 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 D&'222s    
++B,DD	Dc                    || j         vrdS t          | j                                       |          }d}d}d}|}t          j        |           D ]<}|j        }	|j        }
|	|k    r| j        |
         }$|
|k    r|	|k    s|	|k    r|c S |}=dS )a  Extract 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'.
    NZ   a   d   )co_nameslistindexdisBytecodeopcodearg	co_consts)rR   rL   r*   name_idx
STORE_NAMESTORE_GLOBAL
LOAD_CONSTconst	byte_codeopr^   s              r   r   r   }   s     T]""tDM""((00HJLJE\$'' 	 		mN3'EEH__"
"2"2bL6H6HLLLEE	 	r   c                      t           j                            d          st           j        dk    rdS d} | D ]+}t                      |= t                              |           ,dS )z
    Patch the globals to remove the objects not available on some platforms.

    XXX it'd be better to test assertions about bytecode instead.
    javacliN)r   r   )sysplatform
startswithglobals__all__remove)incompatibler   s     r   _update_globalsrq      sk     <""6** s|u/D/D<L  IIdOt r   )rA   N)rA   )rj   rF   r=   r[   setuptools.extern.packagingr   r	   r   r   r   r   r   rn   r
   r@   r   r   rq   r9   r   r   <module>rs      s   



      



 / / / / / / @ @ @ @ @ @ @ @ @ @ @ @        
A- A- A- A- A- A- A- A-H! ! !3 3 3 3:! ! ! !H        r   